aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-10-22 21:58:26 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2023-10-23 22:42:18 -0400
commitfbe8c8938b4efef12a2aa992eec3c947e5f65e70 (patch)
treee15909e1094233b6da95344e2dc5ffd44c82e920 /lib/std/math.zig
parentfe93332ba26b0cb8ca6ecce0b2c605d49a02ca87 (diff)
downloadzig-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.zig4
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));