From 3c046ab9d94c96632bdfd21ad20bea0613bfc1e2 Mon Sep 17 00:00:00 2001
From: IOKG04
- Error Return Traces are enabled by default in {#link|Debug#} and {#link|ReleaseSafe#} builds and disabled by default in {#link|ReleaseFast#} and {#link|ReleaseSmall#} builds. + Error Return Traces are enabled by default in {#link|Debug#} builds and disabled by default in {#link|ReleaseFast#}, {#link|ReleaseSafe#} and {#link|ReleaseSmall#} builds.
There are a few ways to activate this error return tracing feature:
From 84ae54fbe64a15301317716e7f901d81585332d5 Mon Sep 17 00:00:00 2001
From: IOKG04
Modulus division. For unsigned integers this is the same as
- {#syntax#}numerator % denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator > 0{#endsyntax#}, otherwise the
+ {#syntax#}numerator % denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator != 0{#endsyntax#}, otherwise the
operation will result in a {#link|Remainder Division by Zero#} when runtime safety checks are enabled.
Remainder division. For unsigned integers this is the same as
- {#syntax#}numerator % denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator > 0{#endsyntax#}, otherwise the
+ {#syntax#}numerator % denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator != 0{#endsyntax#}, otherwise the
operation will result in a {#link|Remainder Division by Zero#} when runtime safety checks are enabled.
This builtin can be called from a {#link|comptime#} block to conditionally export symbols.
When {#syntax#}@mod(numerator: T, denominator: T) T{#endsyntax#}
@@ -5284,7 +5284,7 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
{#syntax#}@rem(numerator: T, denominator: T) T{#endsyntax#}
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);
From 2dea904d5a1602674d9cd147f8a5f2797dd00c40 Mon Sep 17 00:00:00 2001
From: IOKG04
ptr points to a function with the C calling convention and
- {#syntax#}options.linkage{#endsyntax#} is {#syntax#}.Strong{#endsyntax#}, this is equivalent to
+ {#syntax#}options.linkage{#endsyntax#} is {#syntax#}.strong{#endsyntax#}, this is equivalent to
the {#syntax#}export{#endsyntax#} keyword used on a function: