round-away-from-zero ( x -- y )


Vocabulary
math.extras

Inputs
xa number


Outputs
ya number


Word description
Rounds x via ceiling if x is greater than zero, and floor if x is less than zero.

Examples
USING: math.extras prettyprint ; 0.5 round-away-from-zero .
1.0

USING: math.extras prettyprint ; -0.5 round-away-from-zero .
-1.0


See also
ceiling, floor

Definition


Methods