← Back to archive

Stdle #66 · simd · 2026-08-11

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 v1 = @Vector(4, f32){ 1.0, 2.0, 3.0, 4.0 };
const v2 = @Vector(4, f32){ 5.0, 6.0, 7.0, 8.0 };
const v3 = v1 + v2;
std.debug.print("{d}\n", .{@reduce(.Add, v3)});
}
SIMD
4 attempts left

Answer & explanation