diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-05-09 09:36:17 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-05-09 09:36:23 -0400 |
| commit | 46a4243d9a724f100aaeb2011dbda2a5e222f6ae (patch) | |
| tree | 21c96f5ebd7286e4b6675b84154fd53929f84b44 /Source/Core/Common/FloatUtils.cpp | |
| parent | 5cd02f085314d6b04203e326b4de9531dc601d1a (diff) | |
FloatUtils: Remove using namespace std in ApproximateReciprocal()
This was made quite a long time ago when we supported 32-bit ARM targets
Diffstat (limited to 'Source/Core/Common/FloatUtils.cpp')
| -rw-r--r-- | Source/Core/Common/FloatUtils.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/Core/Common/FloatUtils.cpp b/Source/Core/Common/FloatUtils.cpp index 4bbb4266d6..0cd78c30da 100644 --- a/Source/Core/Common/FloatUtils.cpp +++ b/Source/Core/Common/FloatUtils.cpp @@ -167,12 +167,6 @@ const std::array<BaseAndDec, 32> fres_expected = {{ // Used by fres and ps_res. double ApproximateReciprocal(double val) { - // We are using namespace std scoped here because the Android NDK is complete trash as usual - // For 32bit targets(mips, ARMv7, x86) it doesn't provide an implementation of std::copysign - // but instead provides just global namespace copysign implementations. - // The workaround for this is to just use namespace std within this function's scope - // That way on real toolchains it will use the std:: variant like normal. - using namespace std; union { double valf; @@ -186,23 +180,23 @@ double ApproximateReciprocal(double val) // Special case 0 if (mantissa == 0 && exponent == 0) - return copysign(std::numeric_limits<double>::infinity(), valf); + return std::copysign(std::numeric_limits<double>::infinity(), valf); // Special case NaN-ish numbers if (exponent == (0x7FFLL << 52)) { if (mantissa == 0) - return copysign(0.0, valf); + return std::copysign(0.0, valf); return 0.0 + valf; } // Special case small inputs if (exponent < (895LL << 52)) - return copysign(std::numeric_limits<float>::max(), valf); + return std::copysign(std::numeric_limits<float>::max(), valf); // Special case large inputs if (exponent >= (1149LL << 52)) - return copysign(0.0, valf); + return std::copysign(0.0, valf); exponent = (0x7FDLL << 52) - exponent; |
