2 ms·
For this reason, Zig requires the programmer to specify which is intended when the operator is used on signed integers: var x: i32 = -17 % 12; //compile erro
by AnIdiotOnTheNet 8y ago
For this reason, Zig requires the programmer to specify which is intended when the operator is used on signed integers:
var x: i32 = -17 % 12; //compile error: remainder division with '(integer literal)' and '(integer literal)': signed integers and floats must use @rem or @mod
var y: i32 = @mod(-17, 12); //7
var z: i32 = @rem(-17, 12); //-5