py/formatfloat: Don't print the negative sign of a NaN value. · ggVGc/circuitpython@08a1966 · GitHub
Skip to content

Commit 08a1966

Browse files
committed
py/formatfloat: Don't print the negative sign of a NaN value.
NaN may have the sign bit set but it has no meaning, so don't print it out.
1 parent 81a06d2 commit 08a1966

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

py/formatfloat.c

Lines changed: 2 additions & 2 deletions

tests/float/complex1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959

6060
# check printing of inf/nan
6161
print(float('nan') * 1j)
62+
print(float('-nan') * 1j)
6263
print(float('inf') * (1 + 1j))
6364
print(float('-inf') * (1 + 1j))
6465

tests/float/float1.py

Lines changed: 1 addition & 0 deletions

0 commit comments

Comments
 (0)