mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
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.
This commit is contained in:
@@ -1128,6 +1128,21 @@ typedef double mp_float_t;
|
||||
#define MICROPY_PY_MATH_ISCLOSE (0)
|
||||
#endif
|
||||
|
||||
// Whether to provide fix for atan2 Inf handling.
|
||||
#ifndef MICROPY_PY_MATH_ATAN2_FIX_INFNAN
|
||||
#define MICROPY_PY_MATH_ATAN2_FIX_INFNAN (0)
|
||||
#endif
|
||||
|
||||
// Whether to provide fix for fmod Inf handling.
|
||||
#ifndef MICROPY_PY_MATH_FMOD_FIX_INFNAN
|
||||
#define MICROPY_PY_MATH_FMOD_FIX_INFNAN (0)
|
||||
#endif
|
||||
|
||||
// Whether to provide fix for modf negative zero handling.
|
||||
#ifndef MICROPY_PY_MATH_MODF_FIX_NEGZERO
|
||||
#define MICROPY_PY_MATH_MODF_FIX_NEGZERO (0)
|
||||
#endif
|
||||
|
||||
// Whether to provide "cmath" module
|
||||
#ifndef MICROPY_PY_CMATH
|
||||
#define MICROPY_PY_CMATH (0)
|
||||
|
||||
Reference in New Issue
Block a user