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

vicuna opened this issue Feb 5, 2014 · 1 comment

Infinity vs. NaN in hypot #6321

vicuna opened this issue Feb 5, 2014 · 1 comment


Copy link

@vicuna vicuna 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

Copy link

@vicuna vicuna 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 as completed 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
None yet

No branches or pull requests

1 participant