Rounding options (original) (raw)

Many scrutiny functions have a rounding argument that controls how numbers are rounded. Specify rounding as any of the strings below.

In scrutiny

These options return two rounded numbers for each input number. In consistency tests, this means counting a value set as consistent if the reported number matches either of the two rounded reconstructed numbers.

By contrast, these options only return one rounded number per input:

Rounding at 5 in other software

If the decimal portion to be cut off by rounding is 5, how do these technologies round?

Note on rounding to even

Rounding to the next even number is not reliable. The fundamental facts of floating-point computation imply that results may vary in unpredictable ways. See this explanation of base::round(), or a more general article about the limits of floating-point arithmetic.