-
Notifications
You must be signed in to change notification settings - Fork 1.6k
DRAFT: Expand number Number to support the full integer range #6025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- Update the conversion points between Number and *Amount & STNumber. - Tests probably don't pass.
- Track down and fix edge cases. - Some refactoring and renaming for clarity and simplicity
5cd623f to
4abb6d9
Compare
- Field will be absent in RPC results instead of returning 0.
…number-simple * upstream/develop: chore: Clean up incorrect comments (6031) refactor: Retire MultiSignReserve and ExpandedSignerList amendments (5981)
- Update tests. Unfinished. - TODO: Finish Number tests. Use both modes for STNumber tests. Move mantissa_scale into MantissaRange.
- Fix cross-compiler build issues
b1079c5 to
9310991
Compare
- Nothing really needed to be changed in the tests, but I added a couple of test cases for the min and max int64.
b17225c to
c9ad49f
Compare
- Added test cases min int64. - Updated numberFromJson range checking to use the larger range available from Number.
- Default Number outside of transaction processing to be "large" so RPC will work.
470c9c3 to
248d267
Compare
248d267 to
470c9c3
Compare
Bronek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls fix compilation errors because several functions are no longer constexpr
| Number::lowest() noexcept | ||
| { | ||
| return -Number{maxMantissa, maxExponent, unchecked{}}; | ||
| return -Number{range_.get().max, maxExponent, unchecked{}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is no longer constexpr because it reads from static thread_local range_
| Number::max() noexcept | ||
| { | ||
| return Number{maxMantissa, maxExponent, unchecked{}}; | ||
| return Number{range_.get().max, maxExponent, unchecked{}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is no longer constexpr because it reads from static thread_local range_
| Number::min() noexcept | ||
| { | ||
| return Number{minMantissa, minExponent, unchecked{}}; | ||
| return Number{range_.get().min, minExponent, unchecked{}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is no longer constexpr because it reads from static thread_local range_
| inline constexpr bool | ||
| Number::isnormal() const noexcept | ||
| { | ||
| MantissaRange const& range = range_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is no longer constexpr because it reads from static thread_local range_
| *this = y; | ||
| return *this; | ||
| } | ||
| XRPL_ASSERT( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assert fails in AMM unit tests
ripple.app.AMM Basic Payment
rippled: ../src/libxrpl/basics/Number.cpp:451: ripple::Number& ripple::Number::operator*=(const ripple::Number&): Assertion `("ripple::Number::operator*=(Number) : is normal") && (isnormal() && y.isnormal())' failed.
[1] 364083 IOT instruction (core dumped) ./rippled -u AMM
Still in progress....
This work is on hold in favor of the solution in #6000.
If successful, this will supersede #6000.High Level Overview of Change
Context of Change
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)