From: Craig A. Berry Date: Fri, 7 Jun 2002 22:55:34 +0000 (-0500) Subject: Re: [PATCH] numeric.c:S_mulexp10 -- quit when you can X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c7d80bde0ff1cc98e894e948c628e3ce79d7115f;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH] numeric.c:S_mulexp10 -- quit when you can From: "Craig A. Berry" Message-Id: Handle also underflow on non-IEEE. p4raw-id: //depot/perl@17081 --- diff --git a/numeric.c b/numeric.c index 1cb24d2..f95fde3 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