This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
infnan: Configure scan for fp mantissa bytes
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 11 Jun 2015 02:05:48 +0000 (22:05 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 12 Jun 2015 13:57:16 +0000 (09:57 -0400)
18 files changed:
Configure
Cross/config.sh-arm-linux
NetWare/config.wc
NetWare/config_H.wc
Porting/Glossary
Porting/config.sh
config_h.SH
configure.com
plan9/config_sh.sample
symbian/config.sh
uconfig.sh
uconfig64.sh
win32/config.ce
win32/config.gc
win32/config.vc
win32/config_H.ce
win32/config_H.gc
win32/config_H.vc

index dc636cb..d502690 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -633,6 +633,7 @@ d_ldexpl=''
 d_longdbl=''
 longdblinfbytes=''
 longdblkind=''
+longdblmantbits=''
 longdblnanbytes=''
 longdblsize=''
 d_longlong=''
@@ -1099,6 +1100,7 @@ d_PRIgldbl=''
 d_SCNfldbl=''
 doublekind=''
 doubleinfbytes=''
+doublemantbits=''
 doublenanbytes=''
 sPRIEUldbl=''
 sPRIFUldbl=''
@@ -18759,6 +18761,79 @@ set d_signbit
 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
index 8762282..544efd1 100644 (file)
@@ -614,6 +614,7 @@ dlext='so'
 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()'
@@ -857,6 +858,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu
 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'
index 08abe4c..0e7a682 100644 (file)
@@ -605,6 +605,7 @@ dlext='nlm'
 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()'
@@ -831,7 +832,8 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu
 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'
index e24560f..4ebd1a0 100644 (file)
 #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.
index d59290f..ab63d53 100644 (file)
@@ -2856,6 +2856,13 @@ doublekind (longdblfio.U):
        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.
@@ -4095,6 +4102,14 @@ longdblkind (d_longdbl.U):
        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.
index 2af760e..88b0b81 100644 (file)
@@ -625,6 +625,7 @@ dlext='so'
 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()'
@@ -875,6 +876,7 @@ locincpth='/pro/local/include'
 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'
index 11603a7..6ae8fe2 100755 (executable)
@@ -4858,6 +4858,25 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 #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
index 9600757..6e05e90 100644 (file)
@@ -3663,6 +3663,7 @@ $   longdblsize="0"
 $   longdblkind="0"
 $   longdblinfbytes="undef"
 $   longdblnanbytes="undef"
+$   longdblmantbits="undef"
 $   d_longdbl="undef"
 $   echo "You do not have long double."
 $ ELSE
@@ -3673,6 +3674,7 @@ $   longdblsize = tmp
 $   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
@@ -5573,6 +5575,7 @@ $   i64size="undef"
 $   u64size="undef"
 $ ENDIF
 $!
+$ doublemantbits = "52"
 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
 $ THEN
 $   nvtype="long double"
@@ -6478,6 +6481,7 @@ $ WC "dlsrc='dl_vms.xs'"
 $ 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='" + "'"
index 7171878..7dce0de 100644 (file)
@@ -613,6 +613,7 @@ dlext='none'
 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))'
@@ -839,6 +840,7 @@ locincpth=''
 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'
index 86cc080..27f2e58 100644 (file)
@@ -560,6 +560,7 @@ dlext='dll'
 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))"
@@ -734,6 +735,7 @@ libperl='libperl.a'
 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
index 77b638c..0278020 100644 (file)
@@ -549,6 +549,7 @@ db_version_patch='0'
 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()"
@@ -710,6 +711,7 @@ lib_ext='.a'
 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
index 99d371d..2fefaff 100644 (file)
@@ -550,6 +550,7 @@ db_version_patch='0'
 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))"
@@ -710,6 +711,7 @@ lib_ext='.a'
 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
index f6fe8e5..7ee16c6 100644 (file)
@@ -601,6 +601,7 @@ dlext='dll'
 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()'
@@ -823,6 +824,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu
 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'
index 185d96b..f34d8ec 100644 (file)
@@ -603,6 +603,7 @@ dlltool='~ARCHPREFIX~dlltool'
 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()'
@@ -850,6 +851,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu
 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'
index 2689844..549c140 100644 (file)
@@ -602,6 +602,7 @@ dlext='dll'
 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()'
@@ -849,6 +850,7 @@ locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/inclu
 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'
index c4de904..1766a95 100644 (file)
 #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.
index a442cd0..a9c6162 100644 (file)
 #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.
index 77e38f8..e945b3f 100644 (file)
 #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.