Skip to content

Round

Rounds x to the nearest integer, or to n decimal places.

Round(x)rounds x to the nearest integer, ties away from 0.
Round(x, n)rounds to the nearest : n decimal places, or -- for negative n -- the nearest power of ten.

Domain: Arithmetic

Details
  • Rounds to the nearest integer, with ties (an exact .5) breaking away from 0: and .
  • A second, integer argument n rounds to the nearest instead: positive n gives n decimal places, negative n rounds to the nearest power of ten.
  • agrees with the 1-argument form.
  • Threads element-wise over a list.
  • The digits argument must be an integer; unlike Floor and Ceil, which take no second argument at all, Round is the only one of the three with quantized rounding.

Examples

See also: Floor, Ceil, Clamp