[NumPy-Tickets] [NumPy] #1671: scalars don't raise overflow/underflow/divbyzero/invalid
NumPy Trac
numpy-tickets@scipy....
Thu Nov 11 20:02:13 CST 2010
#1671: scalars don't raise overflow/underflow/divbyzero/invalid
------------------------+---------------------------------------------------
Reporter: m-paradox | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 2.0.0
Component: numpy.core | Version: devel
Keywords: |
------------------------+---------------------------------------------------
Comment(by m-paradox):
I dug in a little bit, and the problem appears to be the compiler
optimizing too liberally. If I add a printf between the operation and
PyUFunc_getfperr() in scalarmathmodule.c.src, it works.
{{{
@name@_ctype_@oper@(arg1, arg2, &out);
printf("Result is %g\n", out);
#endif
#if @fperr@
/* Check status flag. If it is set, then look up what to do */
retstatus = PyUFunc_getfperr();
}}}
I'm guessing the compiler thinks it can reorder the float operation to
after PyUFunc_getfperr, since PyUFunc_getfperr is independent of it except
for the float exception state.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1671#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list