py/objfloat: Fix handling of negative float to power of nan. · csamuelson/circuitpython@8d5a40c · GitHub
Skip to content

Commit 8d5a40c

Browse files
committed
py/objfloat: Fix handling of negative float to power of nan.
Prior to this commit, pow(-2, float('nan')) would return (nan+nanj), or raise an exception on targets that don't support complex numbers. This is fixed to return simply nan, as CPython does. Signed-off-by: Damien George <damien@micropython.org>
1 parent 709398d commit 8d5a40c

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

py/objfloat.c

Lines changed: 1 addition & 1 deletion

tests/float/inf_nan_arith.py

Lines changed: 20 additions & 0 deletions

0 commit comments

Comments
 (0)