Skip to content
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

Closed
8 tasks done
mborland opened this issue May 31, 2024 · 1 comment · Fixed by #683
Closed
8 tasks done

Duplicate operations in basic operations #618

mborland opened this issue May 31, 2024 · 1 comment · Fixed by #683
Assignees

Comments

@mborland
Copy link
Member

mborland commented May 31, 2024

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.

@mborland mborland self-assigned this May 31, 2024
@mborland mborland changed the title Duplicate operations in div_impls Duplicate operations in basic operations Jun 21, 2024
@mborland
Copy link
Member Author

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant