Round

Round[x]

gives the integer closest to x.

Round[x,a]

rounds to the nearest multiple of a.

Details

  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • Round rounds numbers of the form x .5 toward the nearest even integer.
  • Round[x] returns an integer when x is any numeric quantity, whether or not it is an explicit number.
  • For exact numeric quantities, Round internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
  • Round applies separately to real and imaginary parts of complex numbers.
  • Round automatically threads over lists.

Examples

open allclose all

Basic Examples  (2)

Round to the nearest integer:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Round to the nearest multiple of 10:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (5)

Generalizations & Extensions  (1)

Applications  (1)

Properties & Relations  (5)

Possible Issues  (1)

See Also

IntegerPart  Floor  Ceiling  Chop  Rescale  Divisible  Rationalize  FindDivisions

Tutorials

Introduced in 1988
(1.0)
| Updated in 2007
(6.0)