From fbe8c8938b4efef12a2aa992eec3c947e5f65e70 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 22 Oct 2023 21:58:26 -0400 Subject: x86_64: implement `@mod` for floating-point types --- lib/std/math.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/std/math.zig') diff --git a/lib/std/math.zig b/lib/std/math.zig index 57376f4d61..f110efa0af 100644 --- a/lib/std/math.zig +++ b/lib/std/math.zig @@ -903,12 +903,12 @@ pub fn mod(comptime T: type, numerator: T, denominator: T) !T { } test "mod" { + if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; + try testMod(); try comptime testMod(); } fn testMod() !void { - if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; - try testing.expect((mod(i32, -5, 3) catch unreachable) == 1); try testing.expect((mod(i32, 5, 3) catch unreachable) == 2); try testing.expectError(error.NegativeDenominator, mod(i32, 10, -1)); -- cgit v1.2.3