From 7265804170b06211d5f87cf25ffa0962df80ff94 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Wed, 7 Jan 2026 19:43:07 -0500 Subject: [PATCH] Point back to the class documentation in mantissa() and exponent() --- include/xrpl/basics/Number.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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;