8000 nonzero() requires swap for float types (Trac #1662) · Issue #2258 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

nonzero() requires swap for float types (Trac #1662) #2258

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 · 3 comments
Closed

nonzero() requires swap for float types (Trac #1662) #2258

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

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/1662 on 2010-11-05 by @mwiebe, assigned to unknown.

The current floating-point nonzero() implementation is incorrect for non-native byte order. Swapping the order should have no effect, but it can change the result as visible here:

>>> import numpy as np
>>> a = np.array([0x80000000, 0x00000080, 0], dtype=np.uint32)
>>> a.dtype = np.float32
>>> print a.nonzero()
(array([1]),)
>>> print a.byteswap().newbyteorder().nonzero()
(array([0]),)
@numpy-gitbot
Copy link
Author

@mwiebe wrote on 2010-11-05

#10

@numpy-gitbot
Copy link
Author

@charris wrote on 2010-11-07

Fixed in commit 6e5590f. Thanks.

@numpy-gitbot
Copy link
Author

Milestone changed to 1.6.0 by @mwiebe on 2011-05-24

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

1 participant
0