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

Use hypot to implement Complex.norm #10786

Merged
merged 1 commit into from Feb 18, 2022
Merged

Use hypot to implement Complex.norm #10786

merged 1 commit into from Feb 18, 2022

Conversation

Chris00
Copy link
Member

@Chris00 Chris00 commented Nov 21, 2021

I know that OCaml is in feature freeze at the moment but I nonetheless submit this (trivial) PR before I forget!

@Chris00
Copy link
Member Author

Chris00 commented Nov 21, 2021

I do not think a change entry is needed for this.

@dra27
Copy link
Member

dra27 commented Nov 22, 2021

Unless we're absolutely certain that the float representation of every possible outcome is the same, I'd put it in a Changes entry... someone'll notice otherwise! 🙂

Copy link
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

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

Well spotted! This is a nice improvement: even if we use the hypot emulation in runtime/floats.c, NaNs and infinities are handled better in Float.hypot than in the current code for Complex.norm. Plus, we reduce code size.

I agree with @dra27 that a Changes entry would be useful.

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.

None yet

3 participants