You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bullet point that contains this sentence: "For example, in many languages, 1 / 3 is zero, but 1 / 3.0 is a third. OCaml requires you to be explicit about which operation you're doing."
It is syntactically incorrect.
The sentence should read (note the additional period after the 1 and the divisor):
For example, in many languages, 1 / 3 is zero, but 1. /. 3.0 is a third. OCaml requires you to be explicit about which operation you're doing.
The text was updated successfully, but these errors were encountered:
This is intentionally not OCaml syntax. I think the idea is to show what some languages allow and that OCaml is stricter and requires you to be explicit.
Came here to report the same thing - but my comment was that it just seems wrong - replacing "For example, in many languages" with "For example, in OCaml" would correct it.
OCaml version 4.14.2
Enter #help;; for help.
# 1 / 3;;
- : int = 0
# 1.0 /. 3.0;;
- : float = 0.333333333333333315
Python 3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 / 3
0.3333333333333333
>>> 1.0 / 3.0
0.3333333333333333
And if it's not OCaml syntax, what other language uses /.? Can you take another look at this?
For the record, my printed copy (2022) reads:
"For example, in many languages, 1 / 3 is zero, but 1.0 /. 3.0 is a third."
I claim it should read:
"For example, in OCaml, 1 / 3 is zero, but 1.0 /. 3.0 is a third."
(By the way, how do I sign up to leave comments on the website? The FAQ tells me the process but doesn't actually show me where to sign up...)
Chapter 1: "A Guided Tour"
The bullet point that contains this sentence: "For example, in many languages, 1 / 3 is zero, but 1 / 3.0 is a third. OCaml requires you to be explicit about which operation you're doing."
It is syntactically incorrect.
The sentence should read (note the additional period after the 1 and the divisor):
For example, in many languages, 1 / 3 is zero, but 1. /. 3.0 is a third. OCaml requires you to be explicit about which operation you're doing.
The text was updated successfully, but these errors were encountered: