From 0b4461d97b5d315e71302f96076c54bbdffb7717 Mon Sep 17 00:00:00 2001 From: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com> Date: Wed, 14 Dec 2022 01:29:25 +0100 Subject: Fix tautological big_int tests. --- src/value.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/value.zig') diff --git a/src/value.zig b/src/value.zig index f37fec13bb..3d5636ee34 100644 --- a/src/value.zig +++ b/src/value.zig @@ -4194,8 +4194,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( -- cgit v1.2.3