[Numpy-discussion] float128 / longdouble on PPC - is it broken?
Charles R Harris
Tue Oct 25 09:31:13 CDT 2011
On Mon, Oct 24, 2011 at 10:59 PM, Matthew Brett <email@example.com>wrote:
> I just ran into this on a PPC machine:
> In : import numpy as np
> In : np.__version__
> Out: '2.0.0.dev-4daf949'
> In : res = np.longdouble(2)**64
> In : res
> Out: 18446744073709551616.0
> In : 2**64
> Out: 18446744073709551616L
> In : res-1
> Out: 36893488147419103231.0
> Same for numpy 1.4.1.
> I don't have a SPARC to test on but I believe it's the same double-double
The PPC uses two doubles to represent long doubles, the SPARC uses software
emulation of ieee quad precision for long doubles, very different. The
subtraction of 1 working like multiplication by two is strange, perhaps the
one is getting subtracted from the exponent somehow? It would be interesting
to see if the same problem happens in pure c.
As a work around, can I ask what you are trying to do with the long doubles?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion