aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-20 18:29:12 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-20 18:29:12 +0000
commit580546a82bdf65148d19e68296ae51cea5ad9ef2 (patch)
treea6e259bd375b2137431615dc7dea843cb3f0a59e
parent9c0696f153c86a437b87f44102625ddc6a687b71 (diff)
downloadexternal_llvm-580546a82bdf65148d19e68296ae51cea5ad9ef2.zip
external_llvm-580546a82bdf65148d19e68296ae51cea5ad9ef2.tar.gz
external_llvm-580546a82bdf65148d19e68296ae51cea5ad9ef2.tar.bz2
Use INFINITY macro from math.h instead of constructing hex floating point
constants (avoids warnings). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34452 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Support/APInt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index ad728e9..51a1c14 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -17,6 +17,7 @@
#include "llvm/Support/MathExtras.h"
#include <cstring>
#include <cstdlib>
+#include <cmath>
using namespace llvm;
// A utility function for allocating memory, checking for allocation failures,
@@ -837,9 +838,9 @@ double APInt::roundToDouble(bool isSigned) const {
// Return infinity for exponent overflow
if (exp > 1023) {
if (!isSigned || !isNeg)
- return double(0x0.0p2047L); // positive infinity
+ return double(INFINITY); // positive infinity
else
- return double(-0x0.0p2047L); // negative infinity
+ return double(-INFINITY); // negative infinity
}
exp += 1023; // Increment for 1023 bias