summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-02 02:01:34 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-02 02:01:34 +0000
commit9bf94a4a9f1087dd1d418af59e8f76e9a85f655e (patch)
tree52d203a30795630bd8022b4d6e993b753e340701 /lib/Support
parent4474d87fd374dfd5c8b9d29783b73d670540c74f (diff)
downloadllvm-9bf94a4a9f1087dd1d418af59e8f76e9a85f655e.tar.gz
llvm-9bf94a4a9f1087dd1d418af59e8f76e9a85f655e.tar.bz2
llvm-9bf94a4a9f1087dd1d418af59e8f76e9a85f655e.tar.xz
Add a FIXME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APInt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 36f88a2479..5ab16448b7 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -1239,6 +1239,9 @@ APInt APInt::sqrt() const {
}
// Make sure we return the closest approximation
+ // FIXME: This still has an off-by-one error in it. Test case:
+ // 190 bits: sqrt(694114394047834196220892040454508646882614255319893124270) =
+ // 26346050824513229049493703285 (not 26346050824513229049493703284)
APInt square(x_old * x_old);
APInt nextSquare((x_old + 1) * (x_old +1));
if (this->ult(square))