Numbers
WCL has fixed-width signed and unsigned integers plus two float widths. A bare integer literal defaults to i64; a suffix pins the exact type. Underscores may group digits for readability and are ignored. See Expressions for numeric promotion across mixed operands.
Literals
a = 42 // i64 (default)
b = 200u8 // unsigned 8-bit
c = 9_000i64 // underscores are ignored
d = 3.14f64 // float
e = -120i8 // signed
f = 0xFFu32 // hex
g = 0b1010_1100u8 // binary
h = 0o755u16 // octal
Types
| Width | Signed | Unsigned | Float |
|---|---|---|---|
| 8-bit | i8 | u8 | — |
| 16-bit | i16 | u16 | — |
| 32-bit | i32 | u32 | f32 |
| 64-bit | i64 | u64 | f64 |
| 128-bit | i128 | u128 | — |
| platform default size | isize | usize | — |
The platform-default size (isize / usize) is the pointer width of the machine WCL runs on — 64-bit on most desktops/servers, 32-bit on smaller targets — so its exact width changes depending on the platform.
Numeric promotion
Arithmetic and comparison widen mixed numeric operands to a common type, so cross-width and integer/float mixing work without explicit casts.
a = 1 + 2.0 // i64 widened to f64 -> 3.0
b = 1u32 == 1i64 // true
c = 3.0 * 2u8 // 6.0
Number literals: radixes and width suffixes
An integer literal may be written in decimal, hexadecimal (0x), octal (0o), or binary (0b); floats accept scientific notation (1e6). A width suffix pins the exact numeric type, and underscores may group digits for readability (they are ignored).
a = 42 // i64 (default)
b = 200u8 // unsigned 8-bit
c = 9_000i64 // underscores are ignored
d = 3.14f64 // float
f = 0xFFu32 // hex
g = 0b1010_1100u8 // binary
h = 0o755u16 // octal
| Form | Meaning | Example |
|---|---|---|
| 0x… | Hexadecimal integer | 0xFFu32 |
| 0o… | Octal integer | 0o755u16 |
| 0b… | Binary integer | 0b1010_1100u8 |
| …e… | Scientific notation (float) | 1e6 |
| …u32 …i64 | Unsigned/signed integer width suffix | 200u8, 10i64 |
| …f32 …f64 | Float width suffix | 3.14f64 |