If the power of 5 is exact, and the reciprocal exact, the error is zero not one half-ulps. This prevents an infinite loop in rare cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42950 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Neil Booth 2007-10-13 03:34:08 +00:00
parent e765f8ed1a
commit d1a23d573d

View File

@ -1947,7 +1947,7 @@ APFloat::roundSignificandWithExponent(const integerPart *decSigParts,
excessPrecision = calcSemantics.precision; excessPrecision = calcSemantics.precision;
} }
/* Extra half-ulp lost in reciprocal of exponent. */ /* Extra half-ulp lost in reciprocal of exponent. */
powHUerr = 1 + powStatus != opOK; powHUerr = (powStatus == opOK && calcLostFraction == lfExactlyZero) ? 0: 2;
} }
/* Both multiplySignificand and divideSignificand return the /* Both multiplySignificand and divideSignificand return the