forked from rebol/rebol
-
Notifications
You must be signed in to change notification settings - Fork 2
Round
angerangel edited this page Mar 19, 2013
·
1 revision
ROUND value /to scale /even /down /half-down /floor /ceiling /half-ceiling
Rounds a numeric value; halves round up (away from zero) by default.
ROUND is an action value.
- value -- The value to round (number! pair! money! time!)
-
/to -- Return the nearest multiple of the scale parameter
- scale -- Must be a non-zero value (number! money! time!)
- /even -- Halves round toward even results
- /down -- Round toward zero, ignoring discarded digits. (truncate)
- /half-down -- Halves round toward zero
- /floor -- Round in negative direction
- /ceiling -- Round in positive direction
- /half-ceiling -- Halves round in positive direction
#SOURCE
round: make action! [ [
{Rounds a numeric value; halves round up (away from zero) by default.}
value [number! pair! money! time!] "The value to round"
/to "Return the nearest multiple of the scale parameter"
scale [number! money! time!] "Must be a non-zero value"
/even "Halves round toward even results"
/down {Round toward zero, ignoring discarded digits. (truncate)}
/half-down "Halves round toward zero"
/floor "Round in negative direction"
/ceiling "Round in positive direction"
/half-ceiling "Halves round in positive direction"
] ]