Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
avgcorrection
3y ago
0 comments
Share
> If you knew more about the details of binary64 aka float64, you could confidently say that "2.3" means 2.29999995231628417969 […]"
Then I think writing
let f = 2.3;
Should be a compile error. The compiler should force you to write the “snapped” value in order to not mislead. :)
0 comments
default
newest
oldest
a_e_k
3y ago
Now try writing the "snapped" value for 2.3 as a finite decimal. :-)
avgcorrection
OP
3y ago
Something other than 2.29999995231628417969 ?
j
/
k
navigate · click thread line to collapse