[Numpy-discussion] long double woes on win32
Travis E. Oliphant
oliphant at enthought.com
Sat Aug 16 11:50:53 EDT 2008
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.
-Travis
More information about the NumPy-Discussion
mailing list