[NumPy-Tickets] [NumPy] #1755: Raise-FPE test failure on Windows
NumPy Trac
numpy-tickets@scipy....
Fri Mar 4 00:20:55 CST 2011
#1755: Raise-FPE test failure on Windows
-----------------------------------------+----------------------------------
Reporter: rgommers | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.6.0
Component: numpy.core | Version: 1.5.1
Keywords: power, floating point error |
-----------------------------------------+----------------------------------
np.power fails to raise an exception on Windows (tested on py-3.1 and
py-2.6). Test failure:
{{{
======================================================================
FAIL: test_floating_exceptions (test_numeric.TestFloatExceptions)
Test basic arithmetic function errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "Z:\Users\rgommers\.wine\drive_c\Python31\lib\site-
packages\numpy\core\tests\test_numeric.py", line 320, in
test_floating_exceptions
np.power, ftype(2), ftype(2**fi.nexp))
File "Z:\Users\rgommers\.wine\drive_c\Python31\lib\site-
packages\numpy\core\tests\test_numeric.py", line 261, in assert_raises_fpe
"Type %s did not raise fpe error '%s'." % (ftype, fpeerr))
File "Z:\Users\rgommers\.wine\drive_c\Python31\lib\site-
packages\numpy\testing\utils.py", line 34, in assert_
raise AssertionError(msg)
AssertionError: Type <class 'numpy.float64'> did not raise fpe error
'overflow'.
}}}
Result on Windows:
{{{
>>> 2.0 ** 2048
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: (34, 'Result too large')
>>> np.power(2.0, 2048)
inf
}}}
Result on OS X (as expected)
{{{
>>> 2.0**2048
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
OverflowError: (34, 'Result too large')
>>> np.power(2.0, 2048)
Warning: overflow encountered in power
inf
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1755>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list