Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
0 points
koverstreet
1y ago
0 comments
Share
It's somewhat acceptable with double precision floats - never single precision floats.
But far better to just use integer cents.
undefined | Better HN
0 comments
default
newest
oldest
IX-103
1y ago
Integer cents implies a specific rounding mode (truncation). That's probably not what you should be using. Floating point cents gets the best of both worlds (if you set the right rounding mode).
j
/
k
navigate · click thread line to collapse