Point back to the class documentation in mantissa() and exponent()

This commit is contained in:
Ed Hennis
2026-01-07 19:43:07 -05:00
parent a06de68ce4
commit 7265804170

View File

@@ -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<Number::rep>(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;