fn modQ32(x: i32) i16
fn modQ32(x: i32) i16 { var y = @as(i16, @intCast(@rem(x, @as(i32, Q)))); if (y < 0) { y += Q; } return y; }