Message233588
Oh, NaN can be signed?
>>> struct.pack("d", float("nan"))
b'\x00\x00\x00\x00\x00\x00\xf8\x7f'
>>> struct.pack("d", float("-nan"))
b'\x00\x00\x00\x00\x00\x00\xf8\xff'
>>> struct.pack("d", -float("nan"))
b'\x00\x00\x00\x00\x00\x00\xf8\xff'
>>> struct.pack("d", -float("-nan"))
b'\x00\x00\x00\x00\x00\x00\xf8\x7f'
Why does Python return the same representation for positive and negative NaN?
>>> float("nan")
nan
>>> float("-nan")
nan |
|
Date |
User |
Action |
Args |
2015-01-07 17:25:57 | vstinner | set | recipients:
+ vstinner, mark.dickinson, ethan.furman |
2015-01-07 17:25:57 | vstinner | set | messageid: <1420651557.81.0.189420124018.issue23185@psf.upfronthosting.co.za> |
2015-01-07 17:25:57 | vstinner | link | issue23185 messages |
2015-01-07 17:25:57 | vstinner | create | |
|