aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/math.zig
diff options
context:
space:
mode:
authorIOKG04 <iokg04@gmail.com>2025-07-22 13:15:43 +0200
committerIOKG04 <iokg04@gmail.com>2025-07-22 13:35:55 +0200
commit84ae54fbe64a15301317716e7f901d81585332d5 (patch)
tree267187210435e50673405d4e79b518420f03252c /test/behavior/math.zig
parenta91b4aab734ec17273ca8ea5e4a8afabd6193107 (diff)
downloadzig-84ae54fbe64a15301317716e7f901d81585332d5.tar.gz
zig-84ae54fbe64a15301317716e7f901d81585332d5.zip
`@rem()` and `@mod()` take `denominator != 0`, not just `denominator > 0`
https://github.com/ziglang/zig/issues/23635 I also added tests for `@rem()` with `denominator < 0` cause there were none before I hope I added them in the correct place, if not I can change it ofc
Diffstat (limited to 'test/behavior/math.zig')
-rw-r--r--test/behavior/math.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index d51be48198..8b541913b9 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -531,6 +531,8 @@ fn testIntDivision() !void {
try expect(rem(i32, 10, 12) == 10);
try expect(rem(i32, -14, 12) == -2);
try expect(rem(i32, -2, 12) == -2);
+ try expect(rem(i32, 118, -12) == 10);
+ try expect(rem(i32, -14, -12) == -2);
try expect(rem(i16, -118, 12) == -10);
try expect(divTrunc(i20, 20, -5) == -4);