-
Notifications
You must be signed in to change notification settings - Fork 2
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
Duplicate operations in basic operations #618
Labels
Comments
mborland
changed the title
Duplicate operations in div_impls
Duplicate operations in basic operations
Jun 21, 2024
This actually seems to apply to all the basic operations. Adding a task list since dec32 and 64 are trivial but 128 would need extra operators added to uint256_t. Would it be better to just shrink instead of performing additional operations with the uint256_t? Only time will tell. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the division impls we promote the LHS to the next biggest integer type (e.g uint32_t -> uint64_t) and then shrink it back down to return it in a struct that then gets passed ot the decimal constructor: https://github.com/cppalliance/decimal/blob/develop/include/boost/decimal/detail/div_impl.hpp#L80. We can remove all of the shrinking back down steps since the decimal constructor is already designed to handle big integer types. This may or may not apply to dec128 since I don't think the uint256_t case is handled in the constructor since that is only for internal usage.
The text was updated successfully, but these errors were encountered: