From c4cb237ca61bc382de4f89c2464564eabbfb8d8e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 May 2011 06:03:53 +0000 Subject: [PATCH] fix a bug for hosts without round, PR8893. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131842 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APInt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 23a22ac68f3..74d61c13a5c 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -1375,7 +1375,7 @@ APInt APInt::sqrt() const { uint64_t(::round(::sqrt(double(isSingleWord()?VAL:pVal[0]))))); #else return APInt(BitWidth, - uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0]))) + 0.5); + uint64_t(::sqrt(double(isSingleWord()?VAL:pVal[0])) + 0.5)); #endif }