Dodo doc > Syntax > Literal Values > Number Literals


Number literals

Numbers always start with a numeral digit. They can be written in hexadecimal, octal or binary when they start with one of the special prefixes:

0x    hexadecimal
0c    octal
0b    binary

Numbers are not case-sensitive. A separator can be used between significant digits. Most punctuation and whitespace is allowed as separator. Each separator is preceded with backslash. The number must be written on a single line.

Floating point numbers contain a dot or an exponent part or both. They cannot end with a dot. The exponent part is introduced by a "e" followed by an optional sign and one or more digits.

Examples:

33
0x3E\ B4\ 98
0.0
000001234
5E-21
1.760\,012e3
Rationale: since the dot has other meanings in dodo, a floating point number needs digits after the dot. The traditional "0" prefix for octal numbers is ambiguous so dodo uses an explicit prefix letter. Allowing separators in number literals helps readability.


^ 2.4. Literal Values

v 2.4.2. Text String Literals