mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 08:00:22 +00:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user