performance problem in python 2.2

Bjorn Pettersen BPettersen at NAREX.com
Fri Jul 26 23:04:45 EDT 2002


> From: Gerhard Häring [mailto:gerhard.haering at gmx.de] 
> 
> * Paul Rubin <phr-n2002b at NOSPAMnightsong.com> [2002-07-26 
> 18:13 -0700]:
> > Jeff Davis <jdavis at empires.org> writes:
> > 
> > > If you read my C code, you'll see that I used the 'unsigned long 
> > > long type'
> > > which is a 64-bit int. And I only stored 2^32 in it. When 
> I needed to 
> > > crunch the numbers, I treated 2^64 as p*p (because 2^64 == 
> > > sqrt(2^64)*sqrt(2^64) == 2^32*2^32), and then I commuted the 
> > > multiplication so it would happen in a way that wouldn't 
> overflow. 
> > 
> > Oh whoops, yes, I missed that.  "Long long" is not part of 
> standard C,
> 
> It is. C99.

Moreover, it's supported by virtually every compiler except msvc (not even msvc on Win64...)

-- bjorn




More information about the Python-list mailing list