Change 11700 by jhi@alpha on 2001/08/17 02:58:59
Subject: [PATCH perl@11683] IEEE float tweak for VMS
Date: Thu, 16 Aug 2001 22:46:15 -0500
From: "Craig A. Berry" <[EMAIL PROTECTED]>
Message-Id: <5.1.0.14.0.20010816204836.01ab4e58@exchi01>
Affected files ...
... //depot/perl/configure.com#111 edit
... //depot/perl/numeric.c#12 edit
Differences ...
==== //depot/perl/configure.com#111 (text) ====
Index: perl/configure.com
--- perl/configure.com.~1~ Thu Aug 16 21:15:05 2001
+++ perl/configure.com Thu Aug 16 21:15:05 2001
@@ -2352,9 +2352,10 @@
$ be_case_sensitive = "''ans'"
$! IEEE math?
$ echo ""
-$ echo "Perl normally uses G_FLOAT format floating point numbers"
-$ echo "internally, as do most things on VMS. You can, however, build"
-$ echo "with IEEE floating point numbers instead if you need to."
+$ echo "Perl normally uses IEEE format (T_FLOAT) floating point numbers"
+$ echo "internally on Alpha, but if you need G_FLOAT for binary compatibility"
+$ echo "with an external library or existing data, you may wish to disable"
+$ echo "the IEEE math option."
$ dflt = use_ieee_math
$ rp = "Use IEEE math? [''dflt'] "
$ GOSUB myread
==== //depot/perl/numeric.c#12 (text) ====
Index: perl/numeric.c
--- perl/numeric.c.~1~ Thu Aug 16 21:15:05 2001
+++ perl/numeric.c Thu Aug 16 21:15:05 2001
@@ -573,24 +573,21 @@
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
End of Patch.