[SciPy-dev] Infinite loop in machar.py

Ed Schofield schofield at ftw.at
Tue Nov 8 13:06:17 CST 2005



> Hi Pearu,
>
> I'm getting an infinite loop in machar.py when running newcore's long
> double unit test:
>
> check_singleton (scipy.base.getlimits.test_getlimits.test_longdouble)
>
> on a G4 PPC.


Here's a little more detective work:

>>> a = scipy.ones(3, 'g')
>>> a
array([ 0.,  0.,  0.], dtype=float128)
>>> b = a*10
>>> b
array([ 0.,  0.,  0.], dtype=float128)
>>> a == b
array([False, False, False], dtype=bool)
>>> a == a
array([True, True, True], dtype=bool)
>>> 9*a - b == 0
array([False, False, False], dtype=bool)
>>> 10*a - b == 0
array([True, True, True], dtype=bool)
>>> 10*sum(a) - sum(b) == 0
True
>>> 9*sum(a) - sum(b) == 0
False
>>> a = arange(1, 11)
>>> a.prod() == array(3628800, 'g')
True
>>> a.prod() == array(3628801, 'g')
False
>>> c = array(a, 'g')
>>> c.prod() == 3628800
True

So it appears that simple arithmetic operations on long doubles work
partially, but don't display.

Pearu, do you think there really is a bug with long doubles in gcc 4.0 on
PPC, like Robert suggests?  If so, I could add his workaround to the
documentation.  But better would be for us just to disable the float128
type for this architecture (G4) and compiler, since all other tests pass
(well, all those one expects to pass ;)

-- Ed




More information about the Scipy-dev mailing list