test for long double support
What is the recommended way to test for long double and clongdouble? Is it: #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
On 14 September 2010 12:47, Neal Becker <ndbecker2@gmail.com> wrote:
Neal Becker wrote:
What is the recommended way to test for long double and clongdouble?
Is it: #if NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE
I guess I found it?
#if HAVE_LONG_DOUBLE // defined in pyconfig.h
I think these two are different things. For example, MSVC do support 'long double', it is a different type than 'double', but sizeof(long double) == sizeof(double). Also look at CPython's objimpl.h, union _gc_head, you will see an unprotected usage of 'long double', so it seems that CPython requires that the C compiler to support 'long double'. -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169
Also look at CPython's objimpl.h, union _gc_head, you will see an unprotected usage of 'long double', so it seems that CPython requires that the C compiler to support 'long double'.
Long double is IIRC in C89, so compiler support is probably not a problem nowadays. -- Pauli Virtanen
participants (3)
-
Lisandro Dalcin -
Neal Becker -
Pauli Virtanen