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

fix[lang]: define rounding mode for sqrt #4486

Merged
merged 7 commits into from
Feb 23, 2025

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Feb 21, 2025

What I did

fix for GHSA-2p94-8669-xg86

prior to this PR, the rounding mode for sqrt() is undefined. this PR ensures the result is rounded down.

How I did it

How to verify it

Commit message

prior to this commit, the rounding mode for `sqrt()` is undefined,
which could be an issue for applications which use `sqrt()` to
determine boundary conditions. this commit ensures the result is
rounded down.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@charles-cooper charles-cooper added the release - must release blocker label Feb 21, 2025
@charles-cooper charles-cooper added this to the v0.4.1 milestone Feb 21, 2025
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.06%. Comparing base (1ce583b) to head (b19d7c2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4486   +/-   ##
=======================================
  Coverage   92.06%   92.06%           
=======================================
  Files         120      120           
  Lines       17330    17330           
  Branches     2932     2932           
=======================================
  Hits        15955    15955           
  Misses        957      957           
  Partials      418      418           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -146,6 +146,9 @@ def test_sqrt_bounds(sqrt_contract, value):
)
@hypothesis.example(value=Decimal(SizeLimits.MAX_INT128))
@hypothesis.example(value=Decimal(0))
@hypothesis.example(value=Decimal("0.9999999998"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

please leave a link to the advisory to explain the values GHSA-2p94-8669-xg86

Copy link
Member Author

Choose a reason for hiding this comment

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

@cyberthirst
Copy link
Collaborator

let's please also mention the rounding behavior in the documentation

@charles-cooper
Copy link
Member Author

let's please also mention the rounding behavior in the documentation

8157da8

@charles-cooper charles-cooper enabled auto-merge (squash) February 23, 2025 09:21
@charles-cooper charles-cooper merged commit 2ffc8b3 into vyperlang:master Feb 23, 2025
159 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release - must release blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants