Patch to support MSVC, contributed by Morten Ofstad
authorChris Lattner <sabre@nondot.org>
Mon, 25 Oct 2004 18:40:08 +0000 (18:40 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 25 Oct 2004 18:40:08 +0000 (18:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17214 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index fdfda32ee419a0c312d71f896fb81105e2909db8..f84c9e98593a9ed34900d1a45c2c17c3612c12ed 100644 (file)
@@ -1984,7 +1984,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec) {
     cast<ConstantUInt>(ConstantExpr::getCast(SqrtTerm,
                                    SqrtTerm->getType()->getUnsignedVersion()));
   uint64_t SqrtValV = SqrtVal->getValue();
-  uint64_t SqrtValV2 = (uint64_t)sqrt(SqrtValV);
+  uint64_t SqrtValV2 = (uint64_t)sqrt((double)SqrtValV);
   // The square root might not be precise for arbitrary 64-bit integer
   // values.  Do some sanity checks to ensure it's correct.
   if (SqrtValV2*SqrtValV2 > SqrtValV ||