summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2002-06-07 17:55:34 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-08 11:36:29 +0000
commitc7d80bde0ff1cc98e894e948c628e3ce79d7115f (patch)
tree078b9863853cd3b3879b85bb3289293b8ff3caa2 /numeric.c
parent91604d216ebac8463b9593f4d809ca0d39bb6ff8 (diff)
downloadperl-c7d80bde0ff1cc98e894e948c628e3ce79d7115f.tar.gz
Re: [PATCH] numeric.c:S_mulexp10 -- quit when you can
From: "Craig A. Berry" <craigberry@mac.com> Message-Id: <a05111b02b92724737054@[172.16.52.1]> Handle also underflow on non-IEEE. p4raw-id: //depot/perl@17081
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 1cb24d2273..f95fde33d3 100644
--- a/numeric.c
+++ b/numeric.c
@@ -744,9 +744,8 @@ S_mulexp10(NV value, I32 exponent)
* [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) >= (NV_MAX_10_EXP))
- return NV_MAX;
+ if ((log10(value) + exponent) >= (NV_MAX_10_EXP))
+ return negative ? 0.0 : NV_MAX;
#endif
/* In UNICOS and in certain Cray models (such as T90) there is no