diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2007-10-13 03:34:08 +0000 |
---|---|---|
committer | Neil Booth <neil@daikokuya.co.uk> | 2007-10-13 03:34:08 +0000 |
commit | d1a23d573d5408be1cf52358fe03df0bfa07e16e (patch) | |
tree | f6f01038d06c777ab8858fb646b1f7d133de8fb3 /lib/Support/APFloat.cpp | |
parent | e765f8ed1a00082961aed4465dc2a8d86e045d31 (diff) |
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
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r-- | lib/Support/APFloat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 65ec785725..a4c1affb7a 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -1947,7 +1947,7 @@ APFloat::roundSignificandWithExponent(const integerPart *decSigParts, excessPrecision = calcSemantics.precision; } /* 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 |