|
| 1 | +--- pandas/_libs/src/headers/cmath.orig 2023-01-25 23:09:18 UTC |
| 2 | ++++ pandas/_libs/src/headers/cmath |
| 3 | +@@ -0,0 +1,48 @@ |
| 4 | ++#ifndef _PANDAS_MATH_H_ |
| 5 | ++#define _PANDAS_MATH_H_ |
| 6 | ++ |
| 7 | ++// MSVC 2017 has a bug where `x == x` can be true for NaNs. |
| 8 | ++// MSC_VER from https://stackoverflow.com/a/70630/1889400 |
| 9 | ++// Place upper bound on this check once a fixed MSVC is released. |
| 10 | ++#if defined(_MSC_VER) && (_MSC_VER < 1800) |
| 11 | ++#include <cmath> |
| 12 | ++// In older versions of Visual Studio there wasn't a std::signbit defined |
| 13 | ++// This defines it using _copysign |
| 14 | ++namespace std { |
| 15 | ++ __inline int isnan(double x) { return _isnan(x); } |
| 16 | ++ __inline int signbit(double num) { return _copysign(1.0, num) < 0; } |
| 17 | ++ __inline int notnan(double x) { return !isnan(x); } |
| 18 | ++} |
| 19 | ++#elif defined(_MSC_VER) && (_MSC_VER >= 1900) |
| 20 | ++#include <cmath> |
| 21 | ++namespace std { |
| 22 | ++ __inline int isnan(double x) { return _isnan(x); } |
| 23 | ++ __inline int notnan(double x) { return !isnan(x); } |
| 24 | ++} |
| 25 | ++#elif defined(_MSC_VER) |
| 26 | ++#include <cmath> |
| 27 | ++namespace std { |
| 28 | ++ __inline int isnan(double x) { return _isnan(x); } |
| 29 | ++ __inline int notnan(double x) { return x == x; } |
| 30 | ++} |
| 31 | ++#elif defined(__MVS__) |
| 32 | ++#include <cmath> |
| 33 | ++ |
| 34 | ++#define _signbit signbit |
| 35 | ++#undef signbit |
| 36 | ++#undef isnan |
| 37 | ++ |
| 38 | ++namespace std { |
| 39 | ++ __inline int notnan(double x) { return x == x; } |
| 40 | ++ __inline int signbit(double num) { return _signbit(num); } |
| 41 | ++ __inline int isnan(double x) { return isnan(x); } |
| 42 | ++} |
| 43 | ++#else |
| 44 | ++#include <cmath> |
| 45 | ++ |
| 46 | ++namespace std { |
| 47 | ++ __inline int notnan(double x) { return x == x; } |
| 48 | ++} |
| 49 | ++ |
| 50 | ++#endif |
| 51 | ++#endif |
0 commit comments