Sized Integers: i32, u8, usize
Pick the exact width you need.
Integers Carry Their Size
In Zig the width of an integer is part of its type. You always know exactly how many bits a number uses. 🔢
Signed Integers Start with i
A type like i32 is a signed 32-bit integer. The i means it can hold negative values as well as positive ones.
const temperature: i32 = -15;All lessons in this course
- Sized Integers: i32, u8, usize
- Floating Point: f32 and f64
- bool, void, and the Comptime Types
- Number Literals and Underscores