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:
@@ -301,6 +301,10 @@ mp_obj_t mp_obj_float_binary_op(mp_binary_op_t op, mp_float_t lhs_val, mp_obj_t
|
||||
lhs_val = MICROPY_FLOAT_CONST(1.0);
|
||||
break;
|
||||
}
|
||||
if (isnan(rhs_val)) {
|
||||
lhs_val = rhs_val;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
lhs_val = MICROPY_FLOAT_C_FUN(pow)(lhs_val, rhs_val);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user