forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33b647d
commit bc2012a
Showing
3 changed files
with
45 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
#ifndef _PANDAS_MATH_H_ | ||
#define _PANDAS_MATH_H_ | ||
|
||
// MSVC 2017 has a bug where `x == x` can be true for NaNs. | ||
// MSC_VER from https://stackoverflow.com/a/70630/1889400 | ||
// Place upper bound on this check once a fixed MSVC is released. | ||
#if defined(_MSC_VER) && (_MSC_VER < 1800) | ||
#include <cmath> | ||
// In older versions of Visual Studio there wasn't a std::signbit defined | ||
// This defines it using _copysign | ||
#if defined(_MSC_VER) && (_MSC_VER < 1800) | ||
namespace std { | ||
__inline int isnan(double x) { return _isnan(x); } | ||
__inline int signbit(double num) { return _copysign(1.0, num) < 0; } | ||
__inline int notnan(double x) { return !isnan(x); } | ||
} | ||
#elif defined(_MSC_VER) && (_MSC_VER >= 1900) | ||
#include <cmath> | ||
namespace std { | ||
__inline int isnan(double x) { return _isnan(x); } | ||
__inline int notnan(double x) { return !isnan(x); } | ||
} | ||
#elif defined(_MSC_VER) | ||
#include <cmath> | ||
namespace std { | ||
__inline int isnan(double x) { return _isnan(x); } | ||
__inline int signbit(double num) { return _copysign(1.0, num) < 0; } | ||
__inline int notnan(double x) { return x == x; } | ||
} | ||
#else | ||
#include <cmath> | ||
#endif | ||
|
||
namespace std { | ||
__inline int notnan(double x) { return x == x; } | ||
} | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters