From 7cd48a7713cef05285b84e90c0c17cf2f789ad73 Mon Sep 17 00:00:00 2001 From: Ed Hennis Date: Wed, 12 Nov 2025 22:58:06 -0500 Subject: [PATCH] fixup! Continue with Step 1 --- include/xrpl/basics/Number.h | 4 ++-- include/xrpl/protocol/STAmount.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index a1cf296aed..b1a0bb7e8e 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -356,7 +356,7 @@ Number::operator-() const noexcept inline Number& Number::operator++() { - *this += Number{1000000000000000, -15, unchecked{}}; + *this += one(); return *this; } @@ -371,7 +371,7 @@ Number::operator++(int) inline Number& Number::operator--() { - *this -= Number{1000000000000000, -15, unchecked{}}; + *this -= one(); return *this; } diff --git a/include/xrpl/protocol/STAmount.h b/include/xrpl/protocol/STAmount.h index 588906652b..a1682ebde7 100644 --- a/include/xrpl/protocol/STAmount.h +++ b/include/xrpl/protocol/STAmount.h @@ -563,13 +563,13 @@ inline std::tuple STAmount::scaleNumber(A const& asset, Number const& number) { bool const negative = number.mantissa() < 0; + Number const working{negative ? -number : number}; if (asset.integral()) { - return std::make_tuple(std::int64_t(number), 0, negative); + return std::make_tuple(std::int64_t(working), 0, negative); } else { - Number const working{negative ? -number : number}; auto const [mantissa, exponent] = working.normalizeToRange(cMinValue, cMaxValue);