saxbophone / arby

Arbitrary precision arithmetic in C++, even at compile-time
https://saxbophone.com/arby/
Mozilla Public License 2.0
8 stars 1 forks source link

Divmod bug: failing test case on this large calculation #104

Closed saxbophone closed 2 years ago

saxbophone commented 2 years ago

This test case appears to hang infinitely within Nat::divmod():

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);
}

See the attached commit a5769ce as a starting point for debugging this

saxbophone commented 2 years ago

Related to #89