This site is supported by donations to The OEIS Foundation.

Round

From OeisWiki
(Redirected from Nearest integer)
Jump to navigationJump to search


This article page is a stub, please help by expanding it.


Round, by default, corresponds to rounding towards nearest integer; if equidistant (this happens with even bases) to two nearest integers, then rounding towards nearest even integer [balanced rounding]. With balanced rounding, if we have a random half-integer, then the probabilities of rounding up or rounding down are equal (both 50%).

Round to multiple of k corresponds to rounding towards nearest multiple of k; if equidistant to two nearest multiples of k, then rounding towards nearest even multiple of k [balanced rounding]. With balanced rounding, if we have a random half-multiple of k, then the probabilities of rounding up or rounding down are equal (both 50%). The default meaning of round thus means round to multiple of 1. We may also round to multiple of a noninteger, e.g. round to multiple of 0.01. In base b, it is customary to round to a multiple of a given power of b, the default being b0=1.

See also

[edit]