curious problem with large numbers - Due to subprocess
Michael Spencer
mahs at telcopartners.com
Fri Apr 8 15:14:19 EDT 2005
Scott David Daniels wrote:
> Scott David Daniels wrote:
>
>> 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'
>>>>
>>>> Same results (command line vs. Idle) for 2.4.1.
>
>
> On Python 2.2.3: (#42, Jun 4 2003, 10:33:42)
> IDLE 0.8 -- press F1 for help
>
>>>> 1e1000
>
> 1.#INF
>
> So, sometime after that.
>
> --Scott David Daniels
> Scott.Daniels at Acm.Org
>
Problem is associated with executing iteractive input in a subprocess.
>python idle.py -n
IDLE 1.1 ==== No Subprocess ====
>>> 1e10000
1.#INF
>>>
Michael
More information about the Python-list
mailing list