Skip to content

Ensure that all paths of double.Hypot use the absolute value where required - #75776

Merged
tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:fix-75651
Sep 17, 2022
Merged

tannergooding merged 3 commits into
dotnet:mainfrom
tannergooding:fix-75651

Conversation

@tannergooding

Copy link
Copy Markdown
Member

This resolves #75651

@ghost

ghost commented Sep 16, 2022

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost assigned tannergooding Sep 16, 2022
{
// x or y is insignificant compared to the other
result = x + y;
result = ax + ay;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The original C algorithm uses 'x' and 'y', but does so after having reassigned them to be the absolute value.

That is, it effectively does x = abs(x), y = abs(y).

I double checked other usages of x/y and they are all fine/correct.

@ghost

ghost commented Sep 16, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Issue Details

This resolves #75651

Author: tannergooding
Assignees: tannergooding
Labels:

area-System.Numerics

Milestone: -

Comment thread src/libraries/System.Runtime/tests/System/DoubleTests.cs Outdated
@tannergooding
tannergooding merged commit f45df0d into dotnet:main Sep 17, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Oct 18, 2022
@tannergooding
tannergooding deleted the fix-75651 branch November 11, 2022 15:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug in IRootFunctions double.Hypot

3 participants