[Numpy-discussion] long double woes on win32

Charles R Harris charlesr.harris@gmail....
Sat Aug 16 11:15:37 CDT 2008


On Sat, Aug 16, 2008 at 9:50 AM, Travis E. Oliphant
<oliphant@enthought.com>wrote:

> Charles R Harris wrote:
> >
> >
> > Yes. I don't think MS will support "true" long doubles any time soon
> > and this affects printing and the math functions. I'm not sure what
> > the best solution is, there are various possibilities.
> >
> > 1) We could define the numpy longdouble type to be double, which makes
> > us compatible with MS and is effectively what numpy compiled with MSVC
> > does since MSVC long doubles are doubles. Perhaps this could be done
> > by adding a -DNOLONGDOUBLE flag to the compiler flags and then
> > defining longdouble to double. But this means auditing the code to
> > make sure the long double type is never explicitly used so that the
> > mingw compiler does the right thing. I don't think this should be a
> > problem otherwise except for the loss of "true" long doubles and their
> > extra bit of precision.
> All code in numpy uses npy_longdouble which is typedef'd to double if
> SIZEOF_LONGDOUBLE is the same as SIZEOF_DOUBLE.   I don't understand why
> it's a problem to just define SIZEOF_LONGDOUBLE = 8 for mingw which is
> what it is for MSVC.    This makes longdouble 8 bytes.
>

That's my opinion also, I just thought that -DNOLONGDOUBLE was an easy way
to force that choice. David thinks that the function detection in the ufunc
module will be a problem. I need to take a look, perhaps there is a
dependency on include files that differ between the two compilers.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080816/ff3cc35c/attachment.html 


More information about the Numpy-discussion mailing list