Bengt Richter wrote:
Aha! Same version (2.3.4):
Idle:
>>> 1e10000
1.0
>>> import struct; struct.pack('d', 1e10000)
'\x00\x00\x00\x00\x00\x00\xf0?'
(which is actually 1.0)
python via command line (readline support):
>>> 1e10000
1.#INF
>>> import struct; struct.pack('d', 1e10000)
'\x00\x00\x00\x00\x00\x00\xf0\x7f'
Note the difference in the final byte. Same results (command
line vs. Idle) for 2.4.1.
Good aha, but ISTM one of them is more missing than different ;-)
(I.e., returned packed string is length 7 vs 8)
In the first one, the final byte is '?' (I made the same mistake
myself when I first read it).
Also note:
float('1e10000') is 1.#INF both in Idle and from the command line.
I suspect an Idle bug.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list