diff options
| author | stijn | 2020-05-17 12:29:25 +0200 |
|---|---|---|
| committer | Damien George | 2020-05-28 09:54:54 +1000 |
| commit | 81db22f693d06468d45571a29fc0648a8f5664ce (patch) | |
| tree | a4d0621aea1f0dc89ba14a9181b64903a54bc88e /ports/windows | |
| parent | a902b69dd51de0e3fe3bb6955296591d6a93abab (diff) | |
py/modmath: Work around msvc float bugs in atan2, fmod and modf.
Older implementations deal with infinity/negative zero incorrectly. This
commit adds generic fixes that can be enabled by any port that needs them,
along with new tests cases.
Diffstat (limited to 'ports/windows')
| -rw-r--r-- | ports/windows/mpconfigport.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h index 84c196e11..fa09dda75 100644 --- a/ports/windows/mpconfigport.h +++ b/ports/windows/mpconfigport.h @@ -227,6 +227,14 @@ extern const struct _mp_obj_module_t mp_module_time; #define MP_SSIZE_MAX _I32_MAX #endif +// VC++ 12.0 fixes +#if (_MSC_VER <= 1800) +#define MICROPY_PY_MATH_ATAN2_FIX_INFNAN (1) +#define MICROPY_PY_MATH_FMOD_FIX_INFNAN (1) +#ifdef _WIN64 +#define MICROPY_PY_MATH_MODF_FIX_NEGZERO (1) +#endif +#endif // CL specific definitions |
