-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
On win32, np.absolute changes floating point control word #9567
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
Comments
Yeah, numpy shouldn't be changing the precision like this. That's very weird that it is. It looks like I guess the next step might be to look at the disassembly for Are you using the official numpy windows wheels? [edit: sorry, I see now that you said you are.] Is this consistent on both Python 2 and 3? (Wondering if the different MSVC versions might affect anything.) |
Are the official binaries compiled with MSVC or mingwpy? |
The numpy-1.13.1-cp27-none-win32.whl wheel does not change the precision mode. I now have 5 different C compilers, 3 different unix environments. Now I just need a third debugger to proceed. Lovely platform. |
I have MSVC 2017 installed, but here's my contribution:
|
Odd. objdump says that the @xoviat: Try with a |
The 3.6 wheels are built with MSVC 2015, but MSVC 2015 and MSVC 2017 both use the |
Jackpot:
|
@brettcannon Who should we contact about this? |
What an odd bug. @brettcannon: to save you some reading: the bug is that with the 32-bit UCRT, calling CC @zooba as well. |
I guess Numpy should just blacklist hypot on 32-bit MSVC? If so, done in gh-9574. It seems hypot() is indeed the only thing that does this stuff, as far as the test suite can see. |
Sounds reasonable. The implementation of |
Does someone want to submit a MSVC bug report (I'm not up for that.)? Do they take bugreports? |
Yep, we do. I'll email the team with a link to this issue. |
Also |
Uh oh!
There was an error while loading. Please reload this page.
Consider this:
where _control87 returns the floating point control word. Full code in https://github.com/pv/fpread
On win32, using the current numpy 1.13.1 Python 3.6 wheels from Pypi, this prints
I.e., the precision mode changes from 53-bit to 64-bit. On win64 it's 0x0 before and after.
The mode is apparently not changed unless the value passed in to np.absolute is both complex-valued and contains nan or inf.
In addition to
np.absolute
, alsonp.hypot(np.inf, 0)
appears to have the same issue.I'm not sure if this is actually a bug, but it seems strange that
np.absolute
changes the precision mode. This however appears to be a source for some fun as it seems as if this can break gfortran optimizations and make heisenbugs appear.The text was updated successfully, but these errors were encountered: