round ( x -- y )
Factor handbook > The language > Numbers > Mathematical functions > Arithmetic functions

Prev:truncate ( x -- y )
Next:~ ( x y epsilon -- ? )


Vocabulary
math.functions

Inputs and outputs
xa real
ya whole real number


Word description
Outputs the whole number closest to x, rounding out at half.

Notes
The result is not necessarily an integer.

Examples
USING: math.functions prettyprint ; 4.5 round .
5.0

USING: math.functions prettyprint ; 4.4 round .
4.0


Definition


Methods