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.
This commit is contained in:
Damien George
2017-10-04 23:15:55 +11:00
parent 81a06d2c9c
commit 08a196697c
3 changed files with 4 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ ans = (-1.2) ** -3.4; print("%.5g %.5g" % (ans.real, ans.imag))
# check printing of inf/nan
print(float('nan') * 1j)
print(float('-nan') * 1j)
print(float('inf') * (1 + 1j))
print(float('-inf') * (1 + 1j))