From: Jarkko Hietaniemi Date: Sun, 5 Aug 2001 23:07:50 +0000 (+0000) Subject: Avoid SIGFPE in Tru64. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a24374368d9ca399370d0bbf60ebc0aa16225436;p=p5sagit%2Fp5-mst-13.2.git Avoid SIGFPE in Tru64. p4raw-id: //depot/perl@11592 --- diff --git a/numeric.c b/numeric.c index e7a5e8d..8d94975 100644 --- a/numeric.c +++ b/numeric.c @@ -580,6 +580,11 @@ S_mulexp10(NV value, I32 exponent) return NV_MAX; # endif #endif +#if defined(__alpha) && defined(__unix__) + if (!negative && + (log10(value) + exponent) >= (DBL_MAX_10_EXP)) + return NV_INF; +#endif for (bit = 1; exponent; bit <<= 1) { if (exponent & bit) { exponent ^= bit;