diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-22 21:58:26 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-23 22:42:18 -0400 |
| commit | fbe8c8938b4efef12a2aa992eec3c947e5f65e70 (patch) | |
| tree | e15909e1094233b6da95344e2dc5ffd44c82e920 /lib/std/math.zig | |
| parent | fe93332ba26b0cb8ca6ecce0b2c605d49a02ca87 (diff) | |
| download | zig-fbe8c8938b4efef12a2aa992eec3c947e5f65e70.tar.gz zig-fbe8c8938b4efef12a2aa992eec3c947e5f65e70.zip | |
x86_64: implement `@mod` for floating-point types
Diffstat (limited to 'lib/std/math.zig')
| -rw-r--r-- | lib/std/math.zig | 4 |
1 files changed, 2 insertions, 2 deletions
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)); |
