Numeric string parsing rules
">>>" means "until any other symbol has been found" (the text is too dense for exact repetition)
The string is not a number if no numeric characters (0-9) could be parsed. (for example, "+" isn't a number but "0x" is)
- if string begins with 0b and has at least 3 characters, try to read a binary integer
- >>>, 0 or 1 adds the specified bit to the integer
- if string begins with 0o and has at least 3 characters, try to read an octal integer
- >>>, characters 0-7 add the specified 3 bits to the integer
- if string begins with 0x and has at least 3 characters, try to read a hexadecimal integer
- >>>, characters 0-9, a-f and A-F add the specified 4 bits to the integer
- otherwise, try to read a decimal number
- do a test to see if the number is not an integer
- skip the sign character (+ or -)
- skip the 0-9 characters
- if e, E or . is found, try to read a real value
- read the sign character (+ or -)
- >>>, characters 0-9 add the specified decimal number to the whole part
- if the dot character (.) is found, read the fractional part
- >>>, characters 0-9 add the specified decimal number to the fractional part
- if at least 3 more characters can be found and the first is "e" or "E", read the exponent part
- read the sign character (+ or -)
- >>>, characters 0-9 add the specified decimal number to the exponent part
- otherwise, try to read the integer
- read the sign character (+ or -)
- >>>, characters 0-9 add the specified decimal number to the integer
- do a test to see if the number is not an integer