Thanks to visit codestin.com
Credit goes to github.com

Skip to content

inf/nan handling in umath is undefined (Trac #886) #1484

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

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 4 comments
Closed

inf/nan handling in umath is undefined (Trac #886) #1484

numpy-gitbot opened this issue Oct 19, 2012 · 4 comments

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/886 on 2008-08-13 by @pv, assigned to unknown.

The complex-valued ufuncs in numpy.core.umath do not handle inf, nan, and floating-point signals in a well-defined way. The results are platform-dependent. (See eg. #1463 and discussion following [1]).

It might be useful to follow the C99 standard [2] here, possibly looking up how things were recently improved in Python's cmath module.

Some test cases for C99 behavior were backed out in r5644; when this issue is addressed, it would make sense to resurrect them.

[1] http://article.gmane.org/gmane.comp.python.numeric.general/23497

[2] http://www.open-std.org/jtc1/sc22/wg14/www/standards

@numpy-gitbot
Copy link
Author

@pv wrote on 2009-03-03

One possible fix is to use C99 math functions when available. Git branch here:

http://github.com/pv/numpy-work/tree/c99-complex-umath

However, there are a couple of issues:

  • The C library complex functions may be inferior to ours in some aspects:
    eg. in GNU Libc 2.9, casinh(x) == 0 for |x| < eps. Ie. the same loss-of-
    precision error we fixed in numpy Loss of precision in (complex) arcsinh & arctanh (Trac #1008) #1606.
  • Our current own implementations don't agree with C99 special inf/nan point
    values. How to switch the relevant tests to KNOWNFAILs when the C99 functions
    are not available?

@numpy-gitbot
Copy link
Author

Milestone changed to 1.4.0 by @cournape on 2009-03-11

@numpy-gitbot
Copy link
Author

Milestone changed to Unscheduled by @cournape on 2009-11-26

@mattip
Copy link
Member

mattip commented Feb 24, 2021

Closing. This issue is outdated and other issues like gh-17425 now exist for the remaining discrepancies. Please reopen if I am mistaken.

@mattip mattip closed this as completed Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants