Fix tautological big_int tests.

This commit is contained in:
IntegratedQuantum
2022-12-14 01:29:25 +01:00
committed by Andrew Kelley
parent f8ea292d09
commit d6faa4e868
5 changed files with 68 additions and 37 deletions

View File

@@ -4180,8 +4180,12 @@ pub const Value = extern union {
const result_limbs = lhs_bigint.limbs.len -| (shift / (@sizeOf(std.math.big.Limb) * 8));
if (result_limbs == 0) {
// The shift is enough to remove all the bits from the number, which means the
// result is zero.
return Value.zero;
// result is 0 or -1 depending on the sign.
if (lhs_bigint.positive) {
return Value.zero;
} else {
return Value.negative_one;
}
}
const limbs = try allocator.alloc(