News:

Welcome to the new Sinister Design forums!

Main Menu

Rounding numbers

Started by Ertxiem, February 07, 2020, 06:31:31 PM

Previous topic - Next topic

Ertxiem

While reading the post regarding rounding of numbers:
Quote from: CraigStern on February 07, 2020, 05:21:48 PM
[...]
-- fixed: Unity was rounding 0.5 down to 0 instead of up to 1, which is apparently because Mathf.RoundToInt() just uses C#'s default rounding, which was designed for banks and not for games.
I recalled that I learned in school the rule to round to the nearest number, with ties going to the even number. I used it in Physics, Chemistry and Statistics.

Curiosity drove me to take a look at Wikipedia. I was able to find that the reported oldest recommendation of rounding to the nearest number, with ties going to the even number was in a book from 1906. Several names are being used for this type of rounding: convergent rounding, statistician's rounding, Dutch rounding, Gaussian rounding, odd–even rounding, or bankers' rounding (this last term having a bit obscure origin, since there is no strong reference about banks using it).
Ert, the Dead Cow.
With 2 small Mandelbrot sets as the spots.

CraigStern

#1
That's interesting! In school, I was taught that ties always round upwards (away from 0), which is actually quite commonplace (and at least in this article, referred to as "the common method"). I wasn't even aware that other round methods for x.5 values existed until the other day!