-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixUniversalNumber
: Number merge
#4192
Commits on Feb 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4e61fe9 - Browse repository at this point
Copy the full SHA 4e61fe9View commit details -
Add conversions between Number, XRPAmount and int64_t
* Conversions to Number are implicit * Conversions away from Number are explicit and potentially lossy * If lossy, round to nearest, and to even on tie
Configuration menu - View commit details
-
Copy full SHA for 407f041 - Browse repository at this point
Copy the full SHA 407f041View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5744b37 - Browse repository at this point
Copy the full SHA 5744b37View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb0774d - Browse repository at this point
Copy the full SHA eb0774dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 77d9a3d - Browse repository at this point
Copy the full SHA 77d9a3dView commit details -
Use Number for IOUAmount and STAmount arithmetic
* Guarded by amendment fixUniversalNumber * Produces slightly better accuracy in some computations.
Configuration menu - View commit details
-
Copy full SHA for 1746e28 - Browse repository at this point
Copy the full SHA 1746e28View commit details -
Introduce rounding modes for Number:
You can set a thread-local flag to direct Number how to round non-exact results with the syntax: Number::rounding_mode prev_mode = Number::setround(Number::towards_zero); This flag will stay in effect for this thread only until another call to setround. The previously set rounding mode is returned. You can also retrieve the current rounding mode with: Number::rounding_mode current_mode = Number::getround(); The available rounding modes are: * to_nearest : Rounds to nearest representable value. On tie, rounds to even. * towards_zero : Rounds towards zero. * downward : Rounds towards negative infinity. * upward : Rounds towards positive infinity. The default rounding mode is to_nearest.
Configuration menu - View commit details
-
Copy full SHA for 868109d - Browse repository at this point
Copy the full SHA 868109dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6272a34 - Browse repository at this point
Copy the full SHA 6272a34View commit details -
* Taking the negative of a signed negative is UB, but taking the negative of an unsigned is not.
Configuration menu - View commit details
-
Copy full SHA for 5733ff4 - Browse repository at this point
Copy the full SHA 5733ff4View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd97fb5 - Browse repository at this point
Copy the full SHA bd97fb5View commit details -
Replace Number division algorithm
* Replace division with faster algorithm. * Correct some rounding bugs in multiplication. * Add tests for rounding bugs.
Configuration menu - View commit details
-
Copy full SHA for 25c0589 - Browse repository at this point
Copy the full SHA 25c0589View commit details -
Optimize uint128_t division by 10 within Number.cpp
* Optimization includes computing remainder from division. * Used only within Number::operator*=.
Configuration menu - View commit details
-
Copy full SHA for c954a85 - Browse repository at this point
Copy the full SHA c954a85View commit details -
Introduce min/max observers for Number
Three static member functions are introduced with definitions consistent with std::numeric_limits: static constexpr Number min() noexcept; Returns: The minimum positive value. This is the value closest to zero. static constexpr Number max() noexcept; Returns: The maximum possible value. static constexpr Number lowest() noexcept; Returns: The negative value which is less than all other values.
Configuration menu - View commit details
-
Copy full SHA for ff1495b - Browse repository at this point
Copy the full SHA ff1495bView commit details