Message233593
| Author |
serhiy.storchaka |
| Recipients |
ethan.furman, mark.dickinson, serhiy.storchaka, vstinner |
| Date |
2015年01月07日.18:25:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1420655127.93.0.11004486624.issue23185@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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' |
|
History
|
|---|
| 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 |
|