Dec-15-2021, 04:56 PM
(This post was last modified: Dec-15-2021, 04:56 PM by deanhystad.)
In Python 12.5 doesn't round to 13 either. Oops, I see Gribouillis included the odd case of 12.5 in his post.
Numerically your idea of cascaded rounding doesn't make any sense. Rounding should return the closest value and 12.45 is closer to 12 (0.45 difference) than it is 13 (0.55 difference). Your rounding has a positive bias of 0.05. I want my bank to use your rounding when calculating interest on my savings, but I don't want it used to calculate my taxes.
Numerically your idea of cascaded rounding doesn't make any sense. Rounding should return the closest value and 12.45 is closer to 12 (0.45 difference) than it is 13 (0.55 difference). Your rounding has a positive bias of 0.05. I want my bank to use your rounding when calculating interest on my savings, but I don't want it used to calculate my taxes.