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

mulmod and addmod by 0 does not throw #2694

Closed
ethers opened this issue Aug 4, 2017 · 2 comments
Closed

mulmod and addmod by 0 does not throw #2694

ethers opened this issue Aug 4, 2017 · 2 comments

Comments

@ethers
Copy link
Member

ethers commented Aug 4, 2017

mulmod(a, b, 0) is zero, which isn't consistent with #670
Was it missed?

(tested on http://remix.ethereum.org/#version=soljson-v0.4.14+commit.c2215d46.js)

@axic
Copy link
Member

axic commented Aug 4, 2017

I think it was just missed.

Even the documentation says "Division by zero and modulus with zero throws an exception.", though not for the global functions part (where mulmod / addmod) resides.

@axic
Copy link
Member

axic commented Aug 4, 2017

I think fixing this would be a breaking change, since it was missed last time and compiling the same will result in different behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants