diff options
author | Craig A. Berry <craigberry@mac.com> | 2001-08-16 17:46:15 -0500 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-08-17 02:58:59 +0000 |
commit | 24866caad75b79a9904db4da54bae384dd5e4357 (patch) | |
tree | c6f5fe81592ba372ac8172f532feb9e0feeee8bf /numeric.c | |
parent | ba72df33a6d753cf825ef36afa1582ae97353a47 (diff) | |
download | perl-24866caad75b79a9904db4da54bae384dd5e4357.tar.gz |
IEEE float tweak for VMS
Message-Id: <5.1.0.14.0.20010816204836.01ab4e58@exchi01>
p4raw-id: //depot/perl@11700
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -573,24 +573,21 @@ S_mulexp10(NV value, I32 exponent) exponent = -exponent; } - /* Avoid %SYSTEM-F-FLTOVF_F sans VAXC$ESTABLISH. - * In VAX VMS we by default use the D_FLOAT double format, + /* On OpenVMS VAX we by default use the D_FLOAT double format, * and that format does not have *easy* capabilities [1] for - * overflowing doubles 'silently' as IEEE fp does. Therefore we - * need to detect early whether we would overflow (this is - * the behaviour of the native string-to-float conversion routines, - * and therefore the behaviour of native applications, too.) + * overflowing doubles 'silently' as IEEE fp does. We also need + * to support G_FLOAT on both VAX and Alpha, and though the exponent + * range is much larger than D_FLOAT it still doesn't do silent + * overflow. Therefore we need to detect early whether we would + * overflow (this is the behaviour of the native string-to-float + * conversion routines, and therefore of native applications, too). * - * [1] VAXC$EXTABLISH is the capability but it is basically a signal - * handler setup routine, and one cannot return from a fp exception - * handler and except much anything useful. */ -#if defined(VMS) && !defined(__IEEE_FP) -# if defined(__DECC_VER) && __DECC_VER <= 50390006 - /* __F_FLT_MAX_10_EXP - 5 == 33 */ + * [1] Trying to establish a condition handler to trap floating point + * exceptions is not a good idea. */ +#if defined(VMS) && !defined(__IEEE_FP) && defined(NV_MAX_10_EXP) if (!negative && - (log10(value) + exponent) >= (__F_FLT_MAX_10_EXP - 5)) + (log10(value) + exponent) >= (NV_MAX_10_EXP)) return NV_MAX; -# endif #endif /* In UNICOS and in certain Cray models (such as T90) there is no |