- Get rid of MantissaRange::getRanges() function. Rewrite
getMantissaScale to use all constexpr values.
- In Number::Guard::round(), document the "intentional" shadowing of
"mode", and simplify one of the checks. Add an assert.
- Go back to the old method of computing the mantissa, but when post
processing, expand the mantissa to slightly larger than maxMantissa,
then in doRoundDown, if the result is not exact, subtract one.
Finally, let doNormalize figure out the rounding of the result.
- Simplifies the function signatures in Guard, because it doesn't need
to have those values passed in constantly.
- Also simplifies some of the functions because they don't need to store
values just to pass them to Guard functions.
* XRPLF/ximinez/number-round-maxrep-down:
Also fix local 3_2_0 variable names
Future proofing: Rename Large and Enabled to Large330 and Enabled330
clang-tidy: rename MantissaScale enums from "3_2_0" to "320"
* XRPLF/ximinez/number-round-maxrep-down:
Clean up the "New" names
Update to use a new amendment, since this PR will not be part of 3.2.0
fix: Fix Number comparison operator (7406)
feat: Use C++ 23 standard (7431)
refactor: Introduce XRPL_ASSERT_IF for amendment-gated assertions (7378)
refactor: Change config section and key string literals into constants (7095)
refactor: Use `std::move` and `std::string_view` where possible (7424)
refactor: Use const function arguments where possible (7423)
ci: Use XRPLF/actions build-multiarch-image workflow (7428)
ci: Use new packaging images and don't cancel develop builds (7417)
ci: [DEPENDABOT] bump codecov/codecov-action from 6.0.1 to 7.0.0 (7426)
* XRPLF/develop:
fix: Fix Number comparison operator (7406)
feat: Use C++ 23 standard (7431)
refactor: Introduce XRPL_ASSERT_IF for amendment-gated assertions (7378)
* ximinez/number-round-maxrep-down:
Revert "Rollback Number class changes; show the fix works without side effects"
Rollback Number class changes; show the fix works without side effects
Include rounding in failed unit tests
Improve comment descriptions
Rework subtraction rounding (again) for more accuracy
build: Create single test binary xrpl_tests (7327)
ci: [DEPENDABOT] bump actions/checkout from 6.0.2 to 6.0.3 (7414)
ci: Refactor build-related nix / docker / workflows (7408)
refactor: Construct Number::Guard from MantissaRange or relevant fields
ci: Use multiple directories in dependabot config (7413)
ci: Update clang-tidy to nix-based v22 (7412)
clang-tidy: template param names, const correctness, braces
- Go back to the old method of computing the mantissa, but when post
processing, expand the mantissa to slightly larger than maxMantissa,
then in doRoundDown, if the result is not exact, subtract one.
Finally, let doNormalize figure out the rounding of the result.
- Simplifies the function signatures in Guard, because it doesn't need
to have those values passed in constantly.
- Also simplifies some of the functions because they don't need to store
values just to pass them to Guard functions.
- Treat values in between kMaxRep (2^63-1) and kMaxRepUp (((kMaxRep
/ 10) + 1) * 10, which is the next multiple of 10 above kMaxRep) as if
those values were sequential, and values in between were "fractional".
- This results in values above the midpoint rounding up to kMaxRepUp,
and below the midpoint to kMaxRep when rounding to nearest. Other
rounding modes act along the same lines.
- Also refactor "Number::Guard::round()` to return an enum making it
clearer what's going on.
- Add missing headers.
- Improve code coverage exclusions.
- Clean up several variable names.
- Improve explanatory comments.
- Remove the switch statement from MantissaRange::getMin. Change it to
a straight power of ten lookup.
- Simplify Number::operator/= to use more constexpr values, and fewer
variations.
- Most significantly, rounding up doesn't need more precision, it only
needs to know if there's a remainder after the current precision work
is done. Tracked similarly Guard::xbit_.
- Build a constexpr lookup array for powers of 10. Only a handful of
values are used, but since it's built at compile time, and constexpr,
unused values do not affect memory or performance.
- Order the checks so that large mantissa is only enabled if SAV or LP
are enabled. fixCleanup3_2_0 only enables the rounding fix.
- Fix tests, and don't exclude fixCleanup3_2_0 in AMM tests
- Also fix formatting
* XRPLF/develop:
release: Set version to 3.3.0-b0 (7280)
refactor: Rename static constants (7120)
refactor: Use `isFlag` where possible instead of bitwise math (7278)
ci: Update XRPLF/actions (7281)
- Refactor the Guard decision in withTxnType into createGuards, which
lives in Rules.cpp. It is physically located near
setCurrentTransactionRules, and documented to explain that changes
need to be synchronized.
- Add helper function, doDropDigit, to wrap the common pattern:
push(mantissa % 10);
mantissa /= 10;
++exponent;
- Might have been helpful to catch this issue when developing.