Comment by lilyball
4 years ago
When the author started introducing all the calculations to figure out if the printed version would round up, my first thought was, why not just look at the printed version? Print it as %.1f, then chop off anything past the period and re-parse it as an integer. Now you can trivially tell if it rounded up past the threshold and you need to bump the suffix.
No comments yet
Contribute on Hacker News ↗