Thanks for the answer.
Run it with a big number:
f2(9230821908403878236537264867326482638462035732098490238409328947638257462745672354627356427356742563256745362772537532756732673275732,9)
I had this result:
8.1015883211e-06
1.06158743591e-05
512
2009/8/26 Mark Tolonen
>
>
> "Cevahir Demirkira
Mark Tolonen wrote:
"Cevahir Demirkiran" wrote in message
news:3f74e020908251648k7b391a09g78b155507b2f2...@mail.gmail.com...
Hi,
I would like to do a floor division by a power of 2 in python to make it
faster than / (modular division in 2.x).
However, it is slower.
What is the reason of that
The previous one was slower but now it is faster.
How can I make this more consistent?
Why cannot I control it?
Where can I find the algorithms implemented under for example pow, /, %,
etc.?
I could not see them in python documentation?
f2(28136791827937127971286375648628461979219783642686202802
On Tue, Aug 25, 2009 at 8:40 PM, Mark Tolonen wrote:
>
> "Cevahir Demirkiran" wrote in message
> news:3f74e020908251648k7b391a09g78b155507b2f2...@mail.gmail.com...
>>
>> Hi,
>>
>> I would like to do a floor division by a power of 2 in python to make it
>> faster than / (modular division in 2.x).
>
"Cevahir Demirkiran" wrote in message
news:3f74e020908251648k7b391a09g78b155507b2f2...@mail.gmail.com...
Hi,
I would like to do a floor division by a power of 2 in python to make it
faster than / (modular division in 2.x).
However, it is slower.
What is the reason of that?
I checked them via: