Handbook
Glossary
>integer ( x -- n )
Factor handbook
»
The language
»
Numbers
»
Integers
Prev:
>fixnum ( x -- n )
Next:
>bignum ( x -- n )
Vocabulary
math
Inputs
x
a
real
Outputs
n
an
integer
Word description
Converts a real number to an integer, with a possible loss of precision.
Definition
IN:
math
GENERIC:
>integer
( x -- n )
foldable
flushable
Methods
USING:
kernel
layouts
math
math.order
;
M:
bignum
>integer
dup
most-negative-fixnum
most-positive-fixnum
between?
[
>fixnum
]
when
;
USING:
math
;
M:
fixnum
>integer
;
inline
USING:
kernel
layouts
math
math.order
;
M:
real
>integer
dup
most-negative-fixnum
most-positive-fixnum
between?
[
>fixnum
]
[
>bignum
]
if
;
inline