Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 1fa90b9

Browse files
ibuclawdlang-bot
authored andcommitted
core.int128: Add test for udivmod where lower bits of denominator > upper
1 parent eb831db commit 1fa90b9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/int128.d

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ unittest
806806

807807
const Cbig_1 = Cent(0xa3ccac1832952398, 0xc3ac542864f652f8);
808808
const Cbig_2 = Cent(0x5267b85f8a42fc20, 0);
809+
const Cbig_3 = Cent(0xf0000000ffffffff, 0);
809810

810811
/************************/
811812

@@ -895,6 +896,8 @@ unittest
895896
assert(modulus == Cent(0xd83203d0fdc799b8, U.max));
896897
assert(udivmod(Cbig_1, Cbig_2, modulus) == Cent(0x5fe0e9bace2bedad, 2));
897898
assert(modulus == Cent(0x2c923125a68721f8, 0));
899+
assert(div(Cbig_1, Cbig_3) == Cent(0xbfa6c02b5aff8b86, U.max));
900+
assert(udiv(Cbig_1, Cbig_3) == Cent(0xd0b7d13b48cb350f, 0));
898901

899902
assert(mul(Cm10, C1) == Cm10);
900903
assert(mul(C1, Cm10) == Cm10);

0 commit comments

Comments
 (0)