summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
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
commitc44bdae16b03832ce7f8ed19aed250e77db6a5f2 (patch)
treeb63d642446e8d78476df963e73e3059df02fee9a /llvm/lib/Support/APInt.cpp
parent91643aa96fac275e5bdca86b010efdef266292cb (diff)
downloadbcm5719-llvm-c44bdae16b03832ce7f8ed19aed250e77db6a5f2.tar.gz
bcm5719-llvm-c44bdae16b03832ce7f8ed19aed250e77db6a5f2.zip
Add a FIXME
llvm-svn: 34828
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 36f88a24798..5ab16448b77 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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))
OpenPOWER on IntegriCloud