After running numpy.linalg functions, string conversions using str() on some small floating point numbers are corrupted and return “ERR”. This bug occurs with all versions of Numpy win32 for Python2.7 with all releases of Python 2.7. It only occurs with Numpy sse2 architecture enabled and does not occur with "nosse" or "sse3". It was seen first on an older Pentum that only supported up to sse2 so it was the default Numpy installation architecture but the same failure is observed on any newer systems by using the /arch sse2 argument when installing Numpy. On an older system that has only up to sse2 support, the error is avoided by installing Numpy with the /arch nosse argument.
A test script that demonstrates the error is as follows:
Demonstrate fail in numpy for Python 2.7 when installed with SSE2 support (/arch sse2)
import numpy
z = numpy.array([[15,0,672],[0,400,36],[0,0,1]])
beforestr = str(1e-12)
numpy.linalg.inv(z) # This causes second str() to return a different result
afterstr = str(1e-12)
if beforestr != afterstr:
print "FAIL =", beforestr, afterstr
else:
print "PASS"
raw_input("Press any key to continue")
This has been shown to fail with the following versions: Python 2.7.3 with Numpy 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, and 1.7.0b1 and Python 2.7 with Numpy 1.5.0 (just to show all versions from the earliest releases of both Python 2.7 and Numpy for 2.7 fail). This error does not occur with Numpy win32 for Python2.5. The versions tried were Python 2.5.4 with Numpy 1.0.4, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, and 1.7.0b1.
While the observation of the error has only been clearly observed on the string conversion of a float after running linalg, the concern is that other floating point computation problems may be generated by this but I have not discovered them yet.
Original ticket http://projects.scipy.org/numpy/ticket/2206 on 2012-08-23 by trac user ekvamme, assigned to atmention:pv.
After running numpy.linalg functions, string conversions using str() on some small floating point numbers are corrupted and return “ERR”. This bug occurs with all versions of Numpy win32 for Python2.7 with all releases of Python 2.7. It only occurs with Numpy sse2 architecture enabled and does not occur with "nosse" or "sse3". It was seen first on an older Pentum that only supported up to sse2 so it was the default Numpy installation architecture but the same failure is observed on any newer systems by using the /arch sse2 argument when installing Numpy. On an older system that has only up to sse2 support, the error is avoided by installing Numpy with the /arch nosse argument.
A test script that demonstrates the error is as follows:
Demonstrate fail in numpy for Python 2.7 when installed with SSE2 support (/arch sse2)
import numpy
z = numpy.array([[15,0,672],[0,400,36],[0,0,1]])
beforestr = str(1e-12)
numpy.linalg.inv(z) # This causes second str() to return a different result
afterstr = str(1e-12)
if beforestr != afterstr: print "FAIL =", beforestr, afterstr else: print "PASS" raw_input("Press any key to continue")
This has been shown to fail with the following versions: Python 2.7.3 with Numpy 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, and 1.7.0b1 and Python 2.7 with Numpy 1.5.0 (just to show all versions from the earliest releases of both Python 2.7 and Numpy for 2.7 fail). This error does not occur with Numpy win32 for Python2.5. The versions tried were Python 2.5.4 with Numpy 1.0.4, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, and 1.7.0b1.
While the observation of the error has only been clearly observed on the string conversion of a float after running linalg, the concern is that other floating point computation problems may be generated by this but I have not discovered them yet.