8000 BUG: test_umath_accuracy tests for a specific NAN · Issue #15593 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: test_umath_accuracy tests for a specific NAN #15593

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
mattip opened this issue Feb 18, 2020 · 1 comment · Fixed by #15598
Closed

BUG: test_umath_accuracy tests for a specific NAN #15593

mattip opened this issue Feb 18, 2020 · 1 comment · Fixed by #15598
Labels

Comments

@mattip
Copy link
Member
mattip commented Feb 18, 2020

Inside the manylinux2010 i686 docker, log(-1) returns nan, but it is a different nan than the one expected by the data used in test_umath_accuracy. The tests expect 0xffc00000, but the glibc log() function on this platform returns 0x7fc00000. Both are nan, but assert_array_max_ulp uses nulp_diff which is very literal:

>>> import numpy as np, numpy.testing
>>> x = np.int32(0xffc00000).view(np.float32)
>>> y = np.int32(0x7fc00000).view(np.float32)
>>> print(x, y)
nan nan
>>> numpy.testing._private.utils.nulp_diff(y, x)
8388608.0

np.isnan returns True for both.

I think the test be relaxed to accept more than one nan.

@r-devulap
Copy link
Member

I will update the test and submit a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0