diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2015-02-27 16:57:52 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-06-12 09:57:23 -0400 |
commit | 68652010dea6d81e0211abf18bea20c0e046a006 (patch) | |
tree | 4080e5fd38d1387898b94dbe2f3c9d82b9800fd0 /perl.h | |
parent | 9e76e8dd3a4eeeececa2572dad4eb11d8526e286 (diff) | |
download | perl-68652010dea6d81e0211abf18bea20c0e046a006.tar.gz |
infnan: introduce NV_MANT_BITS
(the real bits, not including possible implicit bit)
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -6630,6 +6630,21 @@ extern void moncontrol(int); # endif #endif +/* NV_MANT_BITS is the number of _real_ mantissa bits in an NV. + * For the standard IEEE 754 fp this number is usually one less that + * *DBL_MANT_DIG because of the implicit (aka hidden) bit, which isn't + * real. For the 80-bit extended precision formats (x86*), the number + * of mantissa bits... depends. For normal floats, it's 64. But for + * the inf/nan, it's different (zero for inf, 61 for nan). + * NV_MANT_BITS works for normal floats. */ +#ifdef USE_QUADMATH /* IEEE 754 128-bit */ +# define NV_MANT_BITS (FLT128_MANT_DIG - 1) +#elif NVSIZE == DOUBLESIZE +# define NV_MANT_BITS DOUBLEMANTBITS +#elif NVSIZE == LONG_DOUBLESIZE +# define NV_MANT_BITS LONGDBLMANTBITS +#endif + /* (KEEP THIS LAST IN perl.h!) |