-
Notifications
You must be signed in to change notification settings - Fork 137
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
Return overflowing value when multiplying for UInt256 and Int256 #2389
Comments
@turbolent If I understand correctly, we want to implement The title of this issue is a little confusing. We wouldn't want to change the behavior of |
@darkdrag00nv2 Good question and good idea! I initially thought it might make sense to add a "modular multiplication" operation ( Though maybe there is no need for arbitrary Integer values can be converted between each other, so @quocle108 Would that be sufficient? |
Thanks @turbolent I think we can implement |
@darkdrag00nv2 Sounds good! |
Issue to be solved
There are some cases in which we need to get the overflowing value instead of the maximum value when the overflow happens. For example this case mulDiv(uint256 x, uint256 y, uint256 denominator).
In order to multiply a and b and get the result in 512 bits, we need to get the overflowing value when it happens.
Suggested Solution
No response
The text was updated successfully, but these errors were encountered: