Nearest integer function

From Wikipedia, the free encyclopedia

The nearest integer function
The nearest integer function

In mathematics, the nearest integer function of real number x denoted [x], nint(x), or Round(x), is a function which returns the nearest integer to x. To avoid ambiguity when operating on half-integers, the function is defined to be the nearest even integer in this case — for example,

[1.5] = 2
[2.5] = 2
[3.5] = 4
[4.5] = 4
etc.

This function can be extended to the complex numbers, by application on both the real and imaginary parts simultaneously; i.e. for a complex number z = a + bi, a and b real numbers, we have that [z] = [a] + [b]i.

This function is closely related to the arithmetical practice of rounding, especially Round-to-evens.

[edit] See also

[edit] References