Handbook
Glossary
decimal
Vocabulary
decimals
Definition
IN:
decimals
TUPLE:
decimal
{
mantissa
read-only
}
{
exponent
read-only
}
;
Methods
USING:
decimals
kernel
math.order
;
M:
decimal
<=>
2dup
before?
[
2drop
+lt+
]
[
equal?
+eq+
+gt+
?
]
if
;
inline
USING:
accessors
decimals
kernel
math
math.order
;
M:
decimal
before?
guard-decimals
scale-decimals
[
mantissa>>
]
bi@
<
;
USING:
accessors
combinators.short-circuit
decimals
kernel
;
M:
decimal
equal?
{
[
[
decimal?
]
both?
]
[
scale-decimals
{
[
[
mantissa>>
]
same?
]
[
[
exponent>>
]
same?
]
}
2&&
]
}
2&&
;
USING:
accessors
decimals
kernel
math
math.parser
prettyprint.backend
prettyprint.custom
prettyprint.sections
sequences
strings
;
M:
decimal
pprint*
\
DECIMAL:
[
[
mantissa>>
abs
number>string
]
[
exponent>>
dup
0
>
[
48
<string>
append
]
[
dup
0
<
[
abs
[
48
pad-head
]
[
cut-slice*
]
bi
over
empty?
[
nip
"0."
prepend
]
[
"."
glue
]
if
]
[
drop
]
if
]
if
]
[
mantissa>>
0
<
[
"-"
prepend
]
when
]
tri
text
]
pprint-prefix
;