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:
Damien George
2025-10-01 12:21:27 +10:00
parent 381cd730c8
commit dcbda765d1
3 changed files with 10 additions and 1 deletions

View File

@@ -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