zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 95fe86e3dbd3826ca0971853b275a409ac215c83 (tree)
parent a1e02f33adab3ecdc85a321c4ff9c05762622c40
Author: Robin Voetter <robin@voetter.nl>
Date:   Mon,  4 Oct 2021 11:25:10 +0200

big ints: Fix tests for 32-bit architectures

Diffstat:
Mlib/std/math/big/int_test.zig | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/std/math/big/int_test.zig b/lib/std/math/big/int_test.zig @@ -1020,7 +1020,7 @@ test "big.int mulWrap multi-multi signed" { var c = try Managed.init(testing.allocator); defer c.deinit(); - try c.mulWrap(a.toConst(), b.toConst(), .signed, 128); + try c.mulWrap(a.toConst(), b.toConst(), .signed, @bitSizeOf(SignedDoubleLimb)); try testing.expect((try c.to(SignedDoubleLimb)) == minInt(SignedDoubleLimb) + 2); } @@ -1603,9 +1603,9 @@ test "big.int truncate multi to single unsigned" { var a = try Managed.initSet(testing.allocator, (maxInt(Limb) + 1) | 0x1234_5678_9ABC_DEF0); defer a.deinit(); - try a.truncate(a.toConst(), .unsigned, 37); + try a.truncate(a.toConst(), .unsigned, 27); - try testing.expect((try a.to(u37)) == 0x18_9ABC_DEF0); + try testing.expect((try a.to(u27)) == 0x2BC_DEF0); } test "big.int truncate multi to single signed" {