diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index e4454837c0..f0d544bb76 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -556,6 +556,11 @@ inline Number::Number(rep mantissa) : Number{mantissa, 0} { } +/** Returns the mantissa of the external view of the Number. + * + * Please see the "---- External Interface ----" section of the class + * documentation for an explanation of why the internal value may be modified. + */ inline constexpr Number::rep Number::mantissa() const noexcept { @@ -572,15 +577,19 @@ Number::mantissa() const noexcept return sign * static_cast(m); } +/** Returns the exponent of the external view of the Number. + * + * Please see the "---- External Interface ----" section of the class + * documentation for an explanation of why the internal value may be modified. + */ inline constexpr int Number::exponent() const noexcept { - auto m = mantissa_; auto e = exponent_; - if (m > maxRep) + if (mantissa_ > maxRep) { XRPL_ASSERT_PARTS( - !isnormal() || (m % 10 == 0 && m / 10 <= maxRep), + !isnormal() || (mantissa_ % 10 == 0 && mantissa_ / 10 <= maxRep), "xrpl::Number::exponent", "large normalized mantissa has no remainder"); ++e;