Handbook
Glossary
format-scientific-mantissa ( x log10x digits -- string rounded-up? )
Vocabulary
formatting
.
private
Inputs
x
an
object
log10x
an
object
digits
an
object
Outputs
string
an
object
rounded-up?
an
object
Definition
USING:
kernel
math
math.functions
math.parser
sequences
strings
;
IN:
formatting.private
:
format-scientific-mantissa
( x log10x digits -- string rounded-up? )
[
swap
-
10^
*
round-to-even
>integer
number>string
]
keep
over
length
1
-
<
[
[
but-last
>string
]
when
1
cut
[
"."
glue
]
unless-empty
]
keep
;