1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Use INFINITY macro from math.h instead of constructing hex floating point

constants (avoids warnings).

llvm-svn: 34452
This commit is contained in:
Reid Spencer 2007-02-20 18:29:12 +00:00
parent 80b41ab5f7
commit 4caebb1af8

View File

@ -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