d3bcce5890e329c5335d61371ebbc300e4e82d2e
[rrq/rrqforth.git] / adoc / p_number.adoc
1 // compile.asm: WORD p_number,'NUMBER',fasm
2
3 anchor:p_number[]
4
5 === Word: NUMBER
6
7 ....
8 Data stack: ( char n -- [ 0 ]/[ v 1 ] )
9 ....
10
11 "NUMBER" is a function word that parses a text number using
12 <<p_base,BASE>> as numerical base, then returns the result number and
13 a 1 on top, or just a 0 if the word didn't parse.
14
15 A number consists of, first an optional minus sign, if in
16 <<p_decimal,DECIMAL>> base, then digits 0-9 and, if in <<p_hex,HEX>>
17 base, letters a-f or A-F for values 10-15. I.e. the normal positive or
18 negative decimal integers or normal (positive only) hexadecimal
19 integers.
20
21 ====
22 .Word: NUMBER
23 [caption='Definition concept {counter:exec}: ']
24 ----
25 ( too complex to include here )
26 ----
27 ====