fixup! Continue with Step 1

This commit is contained in:
Ed Hennis
2025-11-12 22:58:06 -05:00
parent d2d403da90
commit 7cd48a7713
2 changed files with 4 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -563,13 +563,13 @@ inline std::tuple<STAmount::mantissa_type, STAmount::exponent_type, bool>
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);