Author: neil
Date: Fri Oct 12 22:34:08 2007
New Revision: 42950
URL: http://llvm.org/viewvc/llvm-project?rev=42950&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Support/APFloat.cpp
Modified: llvm/trunk/lib/Support/APFloat.cpp
URL:
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=42950&r1=42949&r2=42950&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Fri Oct 12 22:34:08 2007
@@ -1947,7 +1947,7 @@
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
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits