summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorPeter Prymmer <PPrymmer@factset.com>2001-06-27 12:25:49 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-28 03:42:57 +0000
commita333faafe1ea79cc2ee6a8e7cd6170ab2dcba713 (patch)
tree2068e958398171b4687f5e8b87c6aeeabc61c176 /numeric.c
parent553150868aad7d92df3feaa82f13bbe93239f442 (diff)
downloadperl-a333faafe1ea79cc2ee6a8e7cd6170ab2dcba713.tar.gz
avoid overflow in numeric.c:S_mulexp10() on VAX
Message-ID: <Pine.OSF.4.10.10106271922120.465082-100000@aspara.forte.com> p4raw-id: //depot/perl@10998
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 58b96d2b76..1aadce5155 100644
--- a/numeric.c
+++ b/numeric.c
@@ -562,6 +562,14 @@ S_mulexp10(NV value, I32 exponent)
negative = 1;
exponent = -exponent;
}
+#ifdef __VAX /* avoid %SYSTEM-F-FLTOVF_F sans VAXC$ESTABLISH */
+# if defined(__DECC_VER) && __DECC_VER <= 50390006
+ /* __F_FLT_MAX_10_EXP - 5 == 33 */
+ if (!negative &&
+ (log10(value) + exponent) >= (__F_FLT_MAX_10_EXP - 5))
+ return NV_MAX;
+# endif
+#endif
for (bit = 1; exponent; bit <<= 1) {
if (exponent & bit) {
exponent ^= bit;