diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-20 18:29:12 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-20 18:29:12 +0000 |
commit | a83af6e1fca165bc2c28daf43a5ebc3ab6e0f5a9 (patch) | |
tree | de46db07e48ea7cd3c9a873c96efdc4335d06b68 /llvm/lib/Support/APInt.cpp | |
parent | fb77b2ba13c96715e80f73cdec930c2abce95209 (diff) | |
download | bcm5719-llvm-a83af6e1fca165bc2c28daf43a5ebc3ab6e0f5a9.tar.gz bcm5719-llvm-a83af6e1fca165bc2c28daf43a5ebc3ab6e0f5a9.zip |
Use INFINITY macro from math.h instead of constructing hex floating point
constants (avoids warnings).
llvm-svn: 34452
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index ad728e9f6a5..51a1c147f0a 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/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 |