Handbook
Glossary
format-fast-decimal? ( x digits -- x' digits ? )
Vocabulary
formatting
.
private
Inputs
x
an
object
digits
an
object
Outputs
x'
an
object
digits
an
object
?
an
object
Definition
USING:
combinators.short-circuit
kernel
math
math.functions
;
IN:
formatting.private
:
format-fast-decimal?
( x digits -- x' digits ? )
over
float?
[
t
]
[
2dup
{
[
drop
dup
integer?
[
abs
53
2^
<
]
[
drop
f
]
if
]
[
over
ratio?
[
[
abs
integer-log10
]
dip
{
~quotation~ ~quotation~
}
2&&
]
[
2drop
f
]
if
]
}
2||
[
[
[
>float
]
dip
]
when
]
keep
]
if
;
inline