News for hackers. Stuff that matters.
Re:Figuring out round, floor and ceil with integer division by cm2187 on Saturday November 26, 2022 @04:08AM (#33751177)
Ok sorry, I think that's me misinterpreting what banker's rounding mean. But I know the regulator will expect round(0.5) = 1, not 0.
Re:Figuring out round, floor and ceil with integer division by masklinn on Saturday November 26, 2022 @05:47AM (#33751618)
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 ∞).