fix: Fix a rounding error at the Number::maxRep cusp

- Add helper function, doDropDigit, to wrap the common pattern:
    push(mantissa % 10);
    mantissa /= 10;
    ++exponent;
- Might have been helpful to catch this issue when developing.
This commit is contained in:
Ed Hennis
2026-04-28 22:28:14 -04:00
parent 8e2aa33f64
commit b40d2a8e7d
17 changed files with 570 additions and 345 deletions

View File

@@ -280,8 +280,7 @@ struct STNumber_test : public beast::unit_test::Suite
{
static_assert(!std::is_convertible_v<STNumber*, Number*>);
for (auto const scale :
{MantissaRange::MantissaScale::Small, MantissaRange::MantissaScale::Large})
for (auto const scale : MantissaRange::getAllScales())
{
NumberMantissaScaleGuard const sg(scale);
testcase << to_string(Number::getMantissaScale());