curious problem with large numbers

Michael Spencer mahs at telcopartners.com
Fri Apr 8 02:08:06 EDT 2005


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).  This is not
>> necessarily a bug in the sense of a fixable bug; floating point has
>> vagaries that are not necessarily easily controllable from the C source
>> side.
> 
> 
> While this may be true, it's pretty strange that Michael Spencer reports 
> apparently correct results on Windows 2.3.3 and 2.4, and I confirm the 
> Windows 2.4 result on my own system, while you report that 2.3.4 gives 
> an error. Or isn't that what you are reporting?
> 
> 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
I guess the behavior is also hardware-dependent.  FWIW, I tested on an Athlon XP 
box.

Michael




More information about the Python-list mailing list