diff options
| author | Linktothepast <kostamarino@gmail.com> | 2015-09-28 16:50:35 +0300 |
|---|---|---|
| committer | Linktothepast <kostamarino@gmail.com> | 2015-09-28 16:50:35 +0300 |
| commit | 748be565b8df535ef558e74b38cd0f4d615f8a21 (patch) | |
| tree | b151efee0a87e99125f2401325a9bddecf84fc73 /Source/Core/Common/MathUtil.cpp | |
| parent | cf17fccdd3093a1b8476b10183b1c4bde36da74d (diff) | |
| parent | ce493b897d6d3735c930a8465cc0c26bbe5feb86 (diff) | |
Merge remote-tracking branch 'dolphin-emu/master' into gameinis
Diffstat (limited to 'Source/Core/Common/MathUtil.cpp')
| -rw-r--r-- | Source/Core/Common/MathUtil.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/Common/MathUtil.cpp b/Source/Core/Common/MathUtil.cpp index 07fa5bf293..a9252ddf55 100644 --- a/Source/Core/Common/MathUtil.cpp +++ b/Source/Core/Common/MathUtil.cpp @@ -209,23 +209,23 @@ double ApproximateReciprocal(double val) // Special case 0 if (mantissa == 0 && exponent == 0) - return sign ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity(); + return std::copysign(std::numeric_limits<double>::infinity(), valf); // Special case NaN-ish numbers if (exponent == (0x7FFLL << 52)) { if (mantissa == 0) - return sign ? -0.0 : 0.0; + return std::copysign(0.0, valf); return 0.0 + valf; } // Special case small inputs if (exponent < (895LL << 52)) - return sign ? -std::numeric_limits<float>::max() : std::numeric_limits<float>::max(); + return std::copysign(std::numeric_limits<float>::max(), valf); // Special case large inputs if (exponent >= (1149LL << 52)) - return sign ? -0.0f : 0.0f; + return std::copysign(0.0, valf); exponent = (0x7FDLL << 52) - exponent; |
