This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python 2.7 builds using icc
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: float('nan') returns 0.0 on Python compiled with icc
View: 21167
Assigned To: Nosy List: Scholes.C, SilentGhost
Priority: normal Keywords:

Created on 2015-02-19 08:53 by Scholes.C, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg236213 - (view) Author: Scholes C (Scholes.C) Date: 2015-02-19 08:53
HI,
can you please look into this ?
thanks.

icc builds of python 2.7 seem to have issues handling nan, inf, etc

$ /usr/local/python-2.7.6/bin/python
Python 2.7.6 (default, Jan 10 2014, 12:14:02)
[GCC Intel(R) C++ gcc 4.1 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print float('nan')
0.0


$ /usr/local/python-2.6.6-64bit/bin/python
Python 2.6.6 (r266:84292, Oct 14 2010, 15:47:19)
[GCC Intel(R) C++ gcc 4.1 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print float('nan')
nan


I tried both –fp-model strict and –fp-model precise compiler options as suggested by http://bugs.python.org/issue21167, but neither seems to resolve other situations like the one with atan2 below:

$ LD_LIBRARY_PATH=/dat/sharefolder_scratch/python-build ./python
Python 2.7.9 (default, Feb 18 2015, 19:58:37)
[GCC Intel(R) C++ gcc 4.1 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print float('nan')
nan
>>> import math
>>> print math.atan2(0, float('nan'))
0.0

$ /usr/local/python-2.6.6-64bit/bin/python
Python 2.6.6 (r266:84292, Oct 14 2010, 15:47:19)
[GCC Intel(R) C++ gcc 4.1 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> print math.atan2(0, float('nan'))
nan
msg236214 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2015-02-19 09:19
I suggest you add this information to issue21167 as it's exactly the same behaviour you're seeing. There really is no need to have a separate issue.
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67671
2015-02-19 14:43:09brett.cannonsetresolution: duplicate
2015-02-19 09:19:28SilentGhostsetstatus: open -> closed

nosy: + SilentGhost
messages: + msg236214

superseder: float('nan') returns 0.0 on Python compiled with icc
2015-02-19 08:53:54Scholes.Ccreate