You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wmul function does not behave as expected in certain cases. In particular, the multiplication of two positive numbers can result in zero. That is true for every a,b > 0 and b < 5*10^17 / a (as shown here).
In such cases, I was expecting the wmul function to revert the transaction instead of returning 0.
Were you aware of this behavior ? If you were, are you planning to modify the library ? I believe the way to go, for a far more reasonable behavior, would be to either revert the transaction if there's a rounding to 0, or properly document this unexpected behavior in the function's docs.
Note that a similar issue happens in rmul
The text was updated successfully, but these errors were encountered:
Rounding to 0 when the result of the multiplication is less than 0.0000000000000000005 is expected behaviour, so that is not a bug. If that is a problem for the application, then it should be checked explicitly.
The
wmul
function does not behave as expected in certain cases. In particular, the multiplication of two positive numbers can result in zero. That is true for every a,b > 0 andb < 5*10^17 / a
(as shown here).In such cases, I was expecting the
wmul
function to revert the transaction instead of returning 0.Were you aware of this behavior ? If you were, are you planning to modify the library ? I believe the way to go, for a far more reasonable behavior, would be to either revert the transaction if there's a rounding to 0, or properly document this unexpected behavior in the function's docs.
Note that a similar issue happens in
rmul
The text was updated successfully, but these errors were encountered: