From 236f00125b5b7de76a7c2be98074844ba71dcf34 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Fri, 7 Jun 2002 13:29:31 -0500 Subject: [PATCH] numeric.c:S_mulexp10 -- quit when you can From: "Craig A. Berry" Message-Id: p4raw-id: //depot/perl@17074 --- numeric.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 1.8.3.1