-
Notifications
You must be signed in to change notification settings - Fork 2
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.
Examples:
123
123.45
-123
Examples:
3%
65.3%
105.7%
-15%
Binary numbers are prefixed with 0b.
Examples:
0b10101
0b101.01
-0b10101
Octal numbers are prefixed with 0o.
Examples:
0o177
0o23.77
-0o12.007
Hexadecimal numbers are prefixed with 0x. Digits can be upper or lower case.
Examples:
0x1F
0x1f
0xaF
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
Scientific E notation numbers are supported. E notation numbers must be base 10.
Examples:
1.234e12
1.234e-24
-5.12E19