mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py/modmath: Make MICROPY_PY_MATH_POW_FIX_NAN also fix pow(x, NaN) cases.
This is needed by the zephyr port. Combining it with the existing `MICROPY_PY_MATH_POW_FIX_NAN` option should be safe, and eliminates the need for a separate option. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -1559,6 +1559,7 @@ typedef time_t mp_timestamp_t;
|
||||
#endif
|
||||
|
||||
// Whether to provide fix for pow(1, NaN) and pow(NaN, 0), which both should be 1 not NaN.
|
||||
// Also fixes pow(base, NaN) to return NaN for other values of base.
|
||||
#ifndef MICROPY_PY_MATH_POW_FIX_NAN
|
||||
#define MICROPY_PY_MATH_POW_FIX_NAN (0)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user