Closed Janiczek closed 4 months ago
Hello! The format used to represent ints is documented precisely in the tour here: https://tour.gleam.run/basics/ints/
The details of the double-precision 64-bit format is out of scope for the tour. It would take a great deal of text to explain all the details of this format, and it is not Gleam specific.
Yes, that's the page I'm talking about. It feels to me like this change would be helpful:
-ints are represented using JavaScript's 64 bit floating point numbers
+ints are represented using JavaScript's 64 bit floating point numbers, effectively limited to -(2^53 - 1) .. 2^53 - 1
Without needing to explain why that mismatch between 64 and 53 is there.
Anyways I respect your decision as to what level of detail to keep :+1:
Hey all, congrats on the launch!
Watching Theo's video getting through the language tour, I wonder whether the section on ints should specify what using JS 64bit floats for ints means.
Coming from Elm world I take it to mean "ints are 53bit" (or 52? can't remember), but I can imagine folks misunderstanding it to be the full 64 bits (as in, MAX_INT = 2^64 - 1 or some such)
Having min/max integers shown in the int lesson would help prevent confusion IMHO.