Skip to content

Comment on Figuring out round, floor and ceil with integer divisionparent

Comments

Banker's rounding is "round to even", because it limits the amount of bias introduced by the rounding.

But I know the regulator will expect round(0.5) = 1, not 0.

That's not necessarily the most helpful, as there's at least two tie-breakings which provide that, but differ in their treatment of negative numbers (round up or round to +∞, and round away from zero or round to ∞).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.