Why isn't Python king of the hill?

Huaiyuan huaiyuan at rac2.wam.umd.edu
Sun Jun 3 20:40:40 EDT 2001


Thomas Wouters <thomas at xs4all.net> writes:

> On Sat, Jun 02, 2001 at 06:12:59PM -0400, Tim Peters wrote:
> > sum = 0
> > for i in range(1, 101):
> >     sum += 1/i
> 
> > In floating-point instead they'd get
> > 
> >     5.1873775176396206
> 
> This must be a very hypothetical python, given that in current Python they'd
> get
>       1
> instead <nudge/wink>.

Not hypothetical; but alternative:

  CMUCL release x86-linux 2.5.2 18c+  2 May 2001 build 2174, running on nomad
  Send questions to cmucl-help at cons.org. 
  ...
  Loaded subsystems:
      Python 1.0, target Intel x86

  * (loop for i from 1 to 100 summing (/ 1 i))
  14466636279520351160221518043104131447711/2788815009188499086581352357412492142272
  * (coerce * 'double-float)
  5.187377517639621d0

Sorry, couldn't resist...

--huaiyuan



More information about the Python-list mailing list