Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
koverstreet
1y ago
0 comments
Save
Share
It's somewhat acceptable with double precision floats - never single precision floats.
But far better to just use integer cents.
0 comments
1 comments · 1 top-level
top
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