next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: round

round -- round a number

Description

Synopsis

  • Usage:
    round x
  • Inputs:
    • x, a number
  • Outputs:
    • the integer nearest to x
i1 : round(-2.3)

o1 = -2
i2 : round(-2.3+5*ii)

o2 = -2
i3 : round(2/3)

o3 = 1

Synopsis

  • Usage:
    round(n,x)
  • Inputs:
  • Outputs:
    • the real number with just n decimal digits to the right of the decimal point nearest to x
i4 : round(2,1234.5678)

o4 = 1234.57

o4 : RR (of precision 53)
i5 : round(-2,1234.5678)

o5 = 1200

o5 : RR (of precision 53)

See also

Ways to use round :