std.math.big.int: normalize zero result for small multiplications
Resolves: #25221
This commit is contained in:
committed by
Alex Rønne Petersen
parent
05b7ca6356
commit
83a3365bfd
@@ -1325,3 +1325,10 @@ test "large enum field values" {
|
||||
try expect(@intFromEnum(e) == std.math.maxInt(i128));
|
||||
}
|
||||
}
|
||||
|
||||
test "comptime @enumFromInt with signed arithmetic" {
|
||||
const E = enum(i8) { foo = -1, bar = 0 };
|
||||
const x: E = @enumFromInt(@as(i8, -1) * 0);
|
||||
comptime assert(x == .bar);
|
||||
comptime assert(@intFromEnum(x) == 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user