Commit edaccded authored by anton's avatar anton

documented S>NUMBER? S>UNUMBER?

minor changes
parent 5c287d96
......@@ -8929,9 +8929,12 @@ doc-edit-line
Conversion words:
doc-s>number?
doc-s>unumber?
doc->number
doc->float
@comment obsolescent words..
Obsolescent input and conversion words:
......
\ Note: This is incorrect ("n fib" produces the result for fib(n+1)),
\ but we do not change it to ensure that future timing results are
\ comparable to older timing results.
: fib ( n1 -- n2 )
dup 2 < if
drop 1
......
......@@ -121,7 +121,7 @@ const Create bases 0A , 10 , 2 , 0A ,
drop
THEN ;
: sign? ( addr u -- addr u flag )
: sign? ( addr u -- addr1 u1 flag )
over c@ [char] - = dup >r
IF
1 /string
......@@ -135,7 +135,8 @@ const Create bases 0A , 10 , 2 , 0A ,
endif
x@+/string 0 s" '" 2rot string-prefix? ;
: s>unumber? ( addr u -- ud flag )
: s>unumber? ( addr u -- ud flag ) \ gforth
\G converts string addr len into ud, flag indicates success
dpl on
over c@ '' = if
1 /string s'>unumber? exit
......@@ -158,8 +159,8 @@ const Create bases 0A , 10 , 2 , 0A ,
r> base ! ;
\ ouch, this is complicated; there must be a simpler way - anton
: s>number? ( addr len -- d f )
\ converts string addr len into d, flag indicates success
: s>number? ( addr len -- d f ) \ gforth
\G converts string addr len into d, flag indicates success
sign? >r
s>unumber?
0= IF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment