Handbook
Glossary
base> ( str radix -- n/f )
Factor handbook
»
The language
»
Numbers
»
Converting between numbers and strings
Prev:
hex> ( str -- n/f )
Vocabulary
math
.
parser
Inputs
str
a
string
radix
an integer between 2 and 16
Outputs
n/f
a
real
or
f
Word description
Creates a real number from a string representation with the given radix. The radix for floating point literals can be either base 10 or base 16.
Outputs
f
if the string does not represent a number.
See also
>base
Definition
USING:
math.parser.private
;
IN:
math.parser
:
base>
( str radix -- n/f )
<number-parse>
[
@first-char-no-radix
]
require-next-digit
;