From: Craig A. Berry Date: Fri, 7 Jun 2002 18:29:31 +0000 (-0500) Subject: numeric.c:S_mulexp10 -- quit when you can X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=236f00125b5b7de76a7c2be98074844ba71dcf34;p=p5sagit%2Fp5-mst-13.2.git numeric.c:S_mulexp10 -- quit when you can From: "Craig A. Berry" Message-Id: p4raw-id: //depot/perl@17074 --- diff --git a/numeric.c b/numeric.c index d214416..1cb24d2 100644 --- a/numeric.c +++ b/numeric.c @@ -766,8 +766,11 @@ S_mulexp10(NV value, I32 exponent) if (exponent & bit) { exponent ^= bit; result *= power; + /* Floating point exceptions are supposed to be turned off, + * but if we're obviously done, don't risk another iteration. + */ + if (exponent == 0) break; } - /* Floating point exceptions are supposed to be turned off. */ power *= power; } return negative ? value / result : value * result;