Message233593
There are several different NaNs.
>>> x = struct.unpack('d', b'\x00\x00\x00\x00\x00\x00\xf8\x7f')[0]
>>> x
nan
>>> x == x
False
>>> struct.pack('d', x)
b'\x00\x00\x00\x00\x00\x00\xf8\x7f'
>>> x = struct.unpack('d', b'\x00\x00\x00\x00\x00\x00\xf9\x7f')[0]
>>> x
nan
>>> x == x
False
>>> struct.pack('d', x)
b'\x00\x00\x00\x00\x00\x00\xf9\x7f'
Interesting, but 0*inf and inf-inf return values with the same representation as float('-nan'), not float('nan').
>>> inf = float("inf")
>>> struct.pack('d', 0*inf)
b'\x00\x00\x00\x00\x00\x00\xf8\xff'
>>> struct.pack('d', inf-inf)
b'\x00\x00\x00\x00\x00\x00\xf8\xff'
>>> 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' |
|
Date |
User |
Action |
Args |
2015-01-07 18:25:27 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, mark.dickinson, vstinner, ethan.furman |
2015-01-07 18:25:27 | serhiy.storchaka | set | messageid: <1420655127.93.0.11004486624.issue23185@psf.upfronthosting.co.za> |
2015-01-07 18:25:27 | serhiy.storchaka | link | issue23185 messages |
2015-01-07 18:25:27 | serhiy.storchaka | create | |
|