Hacker News new | ask | show | jobs
by marian0_ 3206 days ago
Funny he complains so much about incorrect rounding without doing any research: that's called bankers' rounding.

http://wiki.c2.com/?BankersRounding

2 comments

The functions called "ceil" and "floor" shouldn't do banker's rounding - the very names describe what the behavior is supposed to be.
The author is not complaining about the default rounding rule for floats in IEEE 754 (a very thoughtful standard, principally designed by William Kahan, who has several articles/rants about it on his homepage).

The author is complaining about this particular (bad) implementation of ceil and related functions giving incorrect results (some due to said rounding rule).