Skip to content

Avoid overflow on sqrt of Decimal upper bound#1679

Merged
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:sqrt-maxnum
Nov 5, 2019
Merged

Avoid overflow on sqrt of Decimal upper bound#1679
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:sqrt-maxnum

Conversation

@iamdefinitelyahuman
Copy link
Copy Markdown
Contributor

What I did

  • Fixed an overflow when attempting to calculate the sqrt of 2**127

How I did it

vyper/functions/functions.py line 1213, divide before adding.

How to verify it

Run the tests. I've added a new test case to specifically check the upper and lower bounds, as this was discovered by fuzzing.

Description for the changelog

  • Bugfix: sqrt overflow on upper bound of Decimal

Cute Animal Picture

image

Copy link
Copy Markdown
Contributor

@jacqueswww jacqueswww left a comment

Choose a reason for hiding this comment

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

Cool to see latent fuzzy kicking in :)

@fubuloubu fubuloubu merged commit 181c70d into vyperlang:master Nov 5, 2019
@fubuloubu fubuloubu mentioned this pull request Nov 6, 2019
@iamdefinitelyahuman iamdefinitelyahuman deleted the sqrt-maxnum branch December 8, 2019 05:17
@protolambda protolambda mentioned this pull request Jan 20, 2020
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.

3 participants