Fundamentals4 / 9
Up next

Integer and float types

const std = @import("std");

pub fn main() void {
    // Zig integers carry their bit width in the name
    const count: u8 = 200;
    const delta: i64 = -1_000_000;
    // floats are f16/f32/f64/f128
    const ratio: f64 = 3.5;
    std.debug.print("{d} {d} {d:.2}\n", .{ count, delta, ratio });
}
What you're solving

sized ints and floats with format