Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.8k
Update binary-exp.md#1475
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Update binary-exp.md#1475
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Distributive law of modulo over multiplication to handle overflow
Can you give an example of where the previous code fails? |
a = 3 037 000 500; |
The same problem happens with your code:https://www.ideone.com/ZqJd1u Typically, the assumption is M^2 fits into the data type otherwise you must expand the data type for multiplication. |
Distributive law of modulo over multiplication to handle overflow