string>number ( str -- n/f )
Factor handbook » The language » Numbers » Converting between numbers and strings

Prev:>base ( n radix -- str )
Next:bin> ( str -- n/f )


Vocabulary
math.parser

Inputs
stra string


Outputs
n/fa number or f


Word description
Creates a number from its string representation. In addition to real numbers, accepts complex numbers written as a+bj, a-bj or bj. Both components can be integers, ratios or floats. A coefficient of one may be omitted after the sign, as in 2+j.

Rectangular syntax takes precedence over a mixed-ratio imaginary coefficient: 1+1/2j means C{ 1 1/2 }.

Outputs f if the string does not represent a number.

See also
number>string

Definition