d_longdbl=''
longdblinfbytes=''
longdblkind=''
+longdblmantbits=''
longdblnanbytes=''
longdblsize=''
d_longlong=''
d_SCNfldbl=''
doublekind=''
doubleinfbytes=''
+doublemantbits=''
doublenanbytes=''
sPRIEUldbl=''
sPRIFUldbl=''
eval $setvar
$rm_try
+$echo "Checking how many mantissa bits your doubles have..." >&4
+$cat >try.c <<EOP
+#$i_float I_FLOAT
+#$i_sunmath I_SUNMATH
+#ifdef I_FLOAT
+# include <float.h>
+#endif
+#ifdef I_SUNMATH
+# include <sunmath.h>
+#endif
+#ifdef DBL_MANT_DIG
+# define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
+#endif
+#include <stdio.h>
+int main(int argc, char *argv[]) {
+#ifdef BITS
+ printf("%d\n", BITS);
+#endif
+ return 0;
+}
+EOP
+set try
+if eval $compile; then
+ doublemantbits=`$run ./try`
+else
+ doublemantbits="$undef"
+fi
+$rm_try
+
+$echo "Checking how many mantissa bits your long doubles have..." >&4
+$cat >try.c <<EOP
+#$i_float I_FLOAT
+#$i_sunmath I_SUNMATH
+#ifdef I_FLOAT
+# include <float.h>
+#endif
+#ifdef I_SUNMATH
+# include <sunmath.h>
+#endif
+#$d_longdbl HAS_LONG_DOUBLE
+#if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
+# if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
+/* This format has no implicit bit. Beware, however, that for
+ * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
+ * the top three bits are used for inf (100) / qnan (11x) / snan (101),
+ * and the top bit must have been one since 387, zero is plain invalid.
+ * For normal fp values, the LDBL_MANT_DIG is fine, though. */
+# define BITS LDBL_MANT_DIG
+# elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
+/* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
+ * reason e.g. Irix thinks 107. But in any case, we want only
+ * the number of real bits, the implicit bits are of no interest. */
+# define BITS 2 * (DBL_MANT_DIG - 1)
+# else
+# define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
+# endif
+#endif
+#include <stdio.h>
+int main(int argc, char *argv[]) {
+#ifdef BITS
+ printf("%d\n", BITS);
+#endif
+ return 0;
+}
+EOP
+set try
+if eval $compile; then
+ longdblmantbits=`$run ./try`
+else
+ longdblmantbits="$undef"
+fi
+$rm_try
+
: see if sigprocmask exists
set sigprocmask d_sigprocmask
eval $inlibc
dlsrc='dl_dlopen.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind='0'
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize='8'
longlongsize='8'
dlsrc='dl_netware.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
longdblkind='3'
-longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
+longdblmantbits='64'
+longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize='10'
longlongsize='8'
longsize='4'
#define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f /**/
#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f /**/
+/* DOUBLEMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in double precision floating point format.
+ * Note that this is usually DBL_MANT_DIG minus one, since
+ * with the standard IEEE 754 formats DBL_MANT_DIG includes
+ * the implicit bit, which doesn't really exist.
+ */
+#define DOUBLEMANTBITS 52
+
+/* LONGDBLMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in long double precision floating point format.
+ * Note that this can be LDBL_MANT_DIG minus one,
+ * since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ * The common x86-style 80-bit long double does not have
+ * an implicit bit.
+ */
+#define LONGDBLMANTBITS 52
+
/* EBCDIC:
* This symbol, if defined, indicates that this system uses
* EBCDIC encoding.
8 = IEEE 754 64-bit big mixed endian be-le,
-1 = unknown format.
+doublemantbits (mantbits.U):
+ This symbol, if defined, tells how many mantissa bits
+ there are in double precision floating point format.
+ Note that this is usually DBL_MANT_DIG minus one, since
+ with the standard IEEE 754 formats DBL_MANT_DIG includes
+ the implicit bit which doesn't really exist.
+
doublenanbytes (infnan.U):
This variable contains comma-separated list of hexadecimal bytes
for the double precision not-a-number.
4 = x86 80-bit big endian, 5 = double-double 128-bit little endian,
6 = double-double 128-bit big endian, -1 = unknown format.
+longdblmantbits (longdblmant.U):
+ This symbol, if defined, tells how many mantissa bits
+ there are in long double precision floating point format.
+ Note that this can be LDBL_MANT_DIG minus one,
+ since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ The common x86-style 80-bit long double does not have
+ an implicit bit.
+
longdblnanbytes (infnan.U):
This variable contains comma-separated list of hexadecimal bytes
for the long double precision not-a-number.
dlsrc='dl_dlopen.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/pro/local/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind='3'
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize='12'
longlongsize='8'
#define LONGDBLINFBYTES $longdblinfbytes /**/
#define LONGDBLNANBYTES $longdblnanbytes /**/
+/* DOUBLEMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in double precision floating point format.
+ * Note that this is usually DBL_MANT_DIG minus one, since
+ * with the standard IEEE 754 formats DBL_MANT_DIG includes
+ * the implicit bit, which doesn't really exist.
+ */
+#define DOUBLEMANTBITS $doublemantbits
+
+/* LONGDBLMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in long double precision floating point format.
+ * Note that this can be LDBL_MANT_DIG minus one,
+ * since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ * The common x86-style 80-bit long double does not have
+ * an implicit bit.
+ */
+#define LONGDBLMANTBITS $longdblmantbits
+
/* NEED_VA_COPY:
* This symbol, if defined, indicates that the system stores
* the variable argument list datatype, va_list, in a format
$ longdblkind="0"
$ longdblinfbytes="undef"
$ longdblnanbytes="undef"
+$ longdblmantbits="undef"
$ d_longdbl="undef"
$ echo "You do not have long double."
$ ELSE
$ longdblkind = "1"
$ longdblinfbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f"
$ longdblnanbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff"
+$ longdblmantbits="112"
$ d_longdbl = "define"
$ echo "Your long doubles are ''longdblsize' bytes long."
$ ENDIF
$ u64size="undef"
$ ENDIF
$!
+$ doublemantbits = "52"
$ IF uselongdouble .OR. uselongdouble .EQS. "define"
$ THEN
$ nvtype="long double"
$ WC "doublekind='3'"
$ WC "doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'"
$ WC "doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'"
+$ WC "doublemantbits='" + doublemantbits + "'"
$ WC "doublesize='" + doublesize + "'"
$ WC "drand01='" + drand01 + "'"
$ WC "dtrace='" + "'"
dlsrc='dl_none.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='(rand() / (double) ((unsigned long)1 << 15))'
loclibpth=''
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind='0'
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize='8'
longlongsize='8'
dlsrc='dl_symbian.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='4'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))"
localtime_r_proto='0'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind=0
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize=8
longlongsize=8
direntrytype='struct dirent'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01="Perl_drand48()"
localtime_r_proto='0'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind=0
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize=8
longlongsize=8
direntrytype='struct dirent'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01="((rand() & 0x7FFF) / (double) ((unsigned long)1 << 15))"
localtime_r_proto='0'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblkind=0
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
longdblsize=8
longlongsize=8
dlsrc='dl_win32.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
longdblkind='3'
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
longdblsize='10'
longlongsize='8'
dlsrc='dl_win32.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00'
longdblkind='3'
+longdblmantbits='64'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
longdblsize='12'
longlongsize='8'
dlsrc='dl_win32.xs'
doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
doublekind='3'
+doublemantbits='52'
doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
doublesize='8'
drand01='Perl_drand48()'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
longdblkind='0'
+longdblmantbits='52'
longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
longdblsize='8'
longlongsize='8'
#define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f /**/
#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f /**/
+/* DOUBLEMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in double precision floating point format.
+ * Note that this is usually DBL_MANT_DIG minus one, since
+ * with the standard IEEE 754 formats DBL_MANT_DIG includes
+ * the implicit bit, which doesn't really exist.
+ */
+#define DOUBLEMANTBITS 52
+
+/* LONGDBLMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in long double precision floating point format.
+ * Note that this can be LDBL_MANT_DIG minus one,
+ * since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ * The common x86-style 80-bit long double does not have
+ * an implicit bit.
+ */
+#define LONGDBLMANTBITS 52
+
/* EBCDIC:
* This symbol, if defined, indicates that this system uses
* EBCDIC encoding.
#define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00 /**/
#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00 /**/
+/* DOUBLEMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in double precision floating point format.
+ * Note that this is usually DBL_MANT_DIG minus one, since
+ * with the standard IEEE 754 formats DBL_MANT_DIG includes
+ * the implicit bit, which doesn't really exist.
+ */
+#define DOUBLEMANTBITS 52
+
+/* LONGDBLMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in long double precision floating point format.
+ * Note that this can be LDBL_MANT_DIG minus one,
+ * since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ * The common x86-style 80-bit long double does not have
+ * an implicit bit.
+ */
+#define LONGDBLMANTBITS 64
+
/* EBCDIC:
* This symbol, if defined, indicates that this system uses
* EBCDIC encoding.
#define LONGDBLINFBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f /**/
#define LONGDBLNANBYTES 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f /**/
+/* DOUBLEMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in double precision floating point format.
+ * Note that this is usually DBL_MANT_DIG minus one, since
+ * with the standard IEEE 754 formats DBL_MANT_DIG includes
+ * the implicit bit, which doesn't really exist.
+ */
+#define DOUBLEMANTBITS 52
+
+/* LONGDBLMANTBITS:
+ * This symbol, if defined, tells how many mantissa bits
+ * there are in long double precision floating point format.
+ * Note that this can be LDBL_MANT_DIG minus one,
+ * since LDBL_MANT_DIG can include the IEEE 754 implicit bit.
+ * The common x86-style 80-bit long double does not have
+ * an implicit bit.
+ */
+#define LONGDBLMANTBITS 52
+
/* EBCDIC:
* This symbol, if defined, indicates that this system uses
* EBCDIC encoding.