Numeric Literals
Numbers can be written in various bases. Numbers are assumed to be decimal by default. Non-decimal literals have a specific prefix.
Numeral system | Prefix | Characters |
Decimal | None | one or more numbers ( |
Binary |
| one or more zeros or ones ( |
Octal |
| one or more numbers in the range |
Hexadecimal |
| one or more numbers, or characters |
Decimal numbers may contain underscores (_
) to logically separate components.
Underscores are allowed for all numeral systems.
Last updated