Handbook
Glossary
round-to-nearest ( epsilon? mantissa-and-guard rem -- mantissa-and-guard' )
Vocabulary
math
.
integers
.
private
Inputs
epsilon?
an
object
mantissa-and-guard
an
object
rem
an
object
Outputs
mantissa-and-guard'
an
object
Definition
USING:
kernel
math
;
IN:
math.integers.private
:
round-to-nearest
( epsilon? mantissa-and-guard rem -- mantissa-and-guard' )
over
odd?
[
zero?
[
dup
2
bitand
zero?
not
rot
or
[
1
+
]
when
]
[
nip
1
+
]
if
]
[
drop
nip
]
if
;
inline