[Numpy-discussion] supporting quad precision

Robert Kern robert.kern at gmail.com
Mon Jun 10 08:21:09 EDT 2013


On Mon, Jun 10, 2013 at 7:49 AM, Henry Gomersall <heng at cantab.net> wrote:
> On Sun, 2013-06-09 at 12:23 +0100, David Cournapeau wrote:

>> So it depends on the CPU, the OS and the compiler. Using long double
>> for anything else than compatibility (e.g. binary files) is often a
>> mistake IMO, and highly unportable.
>
> Interesting. So long double consistently maps to the platform specific
> long double?

numpy's longdouble dtype should consistently map to the C "long
double" type used by the compiler that was used to build numpy (not
necessarily the same as the one used to build any other extension!).

> With my work on https://github.com/hgomersall/pyFFTW, which supports
> long double as one of the data types, numpy's long double is absolutely
> the right way to do this. Certainly I've managed reasonable success
> across the three main OSs with this approach.

It's certainly the best option in that situation, but you may run into
problems with people using different compilers to build pyFFTW than
what was used to build the numpy binary they have installed.

--
Robert Kern



More information about the NumPy-Discussion mailing list