Division and right shift in python

2009-08-25 Thread Cevahir Demirkıran
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: def f2(x,n): t1 = clock() r = x/pow(2,n) t2 = clock() print (t2-t1) print r t2 = cl

Re: Division and right shift in python

2009-08-26 Thread Cevahir Demirkıran
advance, 26 Ağustos 2009 13:53 tarihinde Cevahir Demirkıran yazdı: > Thanks for the answer. > Run it with a big number: > > f2(9230821908403878236537264867326482638462035732098490238409328947638257462745672354627356427356742563256745362772537532756732673275732,9) > >

Re: Division and right shift in python

2009-08-26 Thread Cevahir Demirkıran
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