0PricingLogin
Zig Academy · Lesson

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

  1. Sized Integers: i32, u8, usize
  2. Floating Point: f32 and f64
  3. bool, void, and the Comptime Types
  4. Number Literals and Underscores
← Back to Zig Academy