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

Edits and checks for modulus, division, and exponentiation #1792

Merged
merged 5 commits into from
Jan 2, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

How I did it

  • For literal modulus calculations, calculate abs(a) % abs(b) and then return a negative value if a < 0. This is consistent with the results of SMOD.
  • Add ZeroDivisionException to allow raising zero division errors with code highlights
  • various minor edits to vyper/parser/expr.py - mostly raising exceptions

How to verify it

Run the tests. I added more test cases around these behaviors.

Cute Animal Picture

image

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase tho

@fubuloubu fubuloubu merged commit 374456c into vyperlang:master Jan 2, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the arithmetic2 branch January 7, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decimals can't be the base for exponentiation Modulo at compile time differs from modulo at runtime
2 participants