Skip to content

Commit

Permalink
Added failing test case for divmod bug in #104
Browse files Browse the repository at this point in the history
  • Loading branch information
saxbophone committed May 28, 2022
1 parent da1bffd commit a5769ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Nat/divmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,12 @@ TEST_CASE("Division of much smaller arby::Nat by much larger arby::Nat", "[divis
// answer should always be zero
CHECK((uintmax_t)(lhs / rhs) == 0);
}

using namespace com::saxbophone::arby::literals;

TEST_CASE("Failing division", "[divmod]") {
auto [quotient, remainder] = arby::Nat::divmod(81238891391892371893_nat, 10000000000_nat);

CHECK(quotient == 8123889139_nat);
CHECK(remainder == 1892371893_nat);
}

0 comments on commit a5769ce

Please sign in to comment.