Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
avgcorrection
3y ago
0 comments
Save
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
2 comments · 1 top-level
top
newest
oldest
a_e_k
3y ago
· 1 in thread
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