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

Infinity vs. NaN in hypot #6321

Closed
vicuna opened this Issue Feb 5, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented Feb 5, 2014

Original bug ID: 6321
Reporter: jfc
Status: closed (set by @xavierleroy on 2017-02-16T14:18:13Z)
Resolution: fixed
Priority: low
Severity: minor
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: standard library
Monitored by: @dbuenzli

Bug description

The ocaml runtime and Unix math runtime return different results for hypot(nan, infinity).

On Unix (Linux and OpenBSD), hypot(infinity, nan) returns infinity. The manual says this is as designed.

The ocaml runtime, when HAS_C99_FLOAT_OPS is not defined, returns nan.

I don't think this is important, but I thought I should point out the inconsistency.

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 11, 2015

Comment author: @xavierleroy

Well spotted, thanks. Fixed in commit [trunk 86d4023], will be part of release 4.03.

@vicuna vicuna closed this Feb 16, 2017

@vicuna vicuna added the stdlib label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.