← Back to archive

Stdle #81 · math · 2026-08-26

What does this Zig snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

const std = @import("std");
pub fn main() void {
const f: f64 = -2.9;
const i: i32 = @intFromFloat(f);
std.debug.print("{d}\n", .{i});
}
Math
4 attempts left

Answer & explanation