Skip to content

Numbers

Jordan Leppert edited this page Jan 9, 2025 · 13 revisions

All numbers can have decimal points. All number types can also be negative, by prefixing the number with a -. The - always goes before any other prefix, such as base prefixes.

Decimal

Examples:

123
123.45
-123

Percentage

Examples:

3%
65.3%
105.7%
-15%

Non-decimal

Binary

Binary numbers are prefixed with 0b.

Examples:

0b10101
0b101.01
-0b10101

Octal

Octal numbers are prefixed with 0o.

Examples:

0o177
0o23.77
-0o12.007

Hexadecimal

Hexadecimal numbers are prefixed with 0x. Digits can be upper or lower case.

Examples:

0x1F
0x1f
0xaF

Other bases

Numbers of any base from 2 to 36 are possible, with the syntax: <base>Z<number>. The 'z' is case insensitive. Digits can be upper or lower case.

Examples:

12z36
36Z1Z
-36Z1z.5

E notation

Scientific E notation numbers are supported. E notation numbers must be base 10.

Examples:

1.234e12
1.234e-24
-5.12E19

Clone this wiki locally