diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h index c5d24f7a03..906913c423 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -4,6 +4,8 @@ #pragma once +#include + #include "Common/CPUDetect.h" #include "Common/MathUtil.h" #include "Core/PowerPC/Interpreter/Interpreter.h" @@ -307,7 +309,8 @@ inline double ApproximateReciprocal(double val) // Special case 0 if (mantissa == 0 && exponent == 0) - return sign ? -INFINITY : INFINITY; + return sign ? -std::numeric_limits::infinity() : + std::numeric_limits::infinity(); // Special case NaN-ish numbers if (exponent == (0x7FFLL << 52)) { @@ -364,17 +367,22 @@ inline double ApproximateReciprocalSquareRoot(double val) // Special case 0 if (mantissa == 0 && exponent == 0) - return sign ? -INFINITY : INFINITY; + return sign ? -std::numeric_limits::infinity() : + std::numeric_limits::infinity(); // Special case NaN-ish numbers if (exponent == (0x7FFLL << 52)) { if (mantissa == 0) - return sign ? NAN : 0.0; + { + if (sign) + return std::numeric_limits::quiet_NaN(); + return 0.0; + } return 0.0 + valf; } // Negative numbers return NaN if (sign) - return NAN; + return std::numeric_limits::quiet_NaN(); if (!exponent) {