Re: curious problem with large numbers



On Fri, 08 Apr 2005 09:05:39 -0700, Scott David Daniels <Scott.Daniels@xxxxxxx> wrote:

>Steve Holden wrote:
>> Scott David Daniels wrote:
>>
>>> Terry Reedy wrote:
>>>
>>>> On my Windows machine with 2.2.1, I get exactly what you expected:
>>>>
>>>>>>> 1e10000
>>>>
>>>> 1.#INF
>>>> ...
>>>> If you get wrong behavior on a later version, then a bug has been
>>>> introduced somewhere, even perhaps in VC 7, used for 2.4.
>>>
>>> Nope, it is also there for 2.3.4 (May 25 2004, 21:17:02)....
>>
>> A further Windows data point from Cygwin:
>>
>> Python 2.4 (#1, Dec 4 2004, 20:10:33)
>> [GCC 3.3.3 (cygwin special)] on cygwin
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> 1e10000
>> Inf
>> >>>
>>
>> regards
>> Steve
>
>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)

Regards,
Bengt Richter
.



Relevant Pages

  • Re: Component Registration Failure
    ... You could try running the following command from a command prompt: ... Execute the command regsvr32.exe atl.dll ... The message was checked by ESET Smart Security. ...
    (microsoft.public.windows.mediacenter)
  • Re: [opensuse] Installation methods
    ... >> Regards, Rajko. ... I downloaded a script yesterday. ... So I should have ran "chmod 777 ... I also ran the chmod command for yet another program I was attempting to ...
    (SuSE)
  • Re: Creating Recovery CD problem
    ... > second one (use format command). ... Then you copy SDI file to the second partition and expand it to the first one with command like ... >> I did a little test on KM's advice ... >> thanks regards and Merry Christmas. ...
    (microsoft.public.windowsxp.embedded)
  • Re: ntfs.sys missing or corrupt
    ... indicated in this command. ... If the ntfs.sys file is there and corrupt it will rename it. ... not there then it was missing. ...
    (microsoft.public.windowsxp.general)
  • Re: Running DOS utilities in XP
    ... I had never heard of that "facility" - but it only allows a choice of Windows versions - and with WIN '95 I got the same result. ... Regards ... I have never seen the compatibility mode work for anything... ... try "command" probably won't work either, ...
    (microsoft.public.windowsxp.newusers)