Hi,<br><br>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).<br>However, it is slower.<br>What is the reason of that? <br>I checked them via:<br><br> def f2(x,n):<br>
t1 = clock()<br> r = x/pow(2,n)<br> t2 = clock()<br> print (t2-t1)<br> print r<br> t2 = clock()<br> r = x>>n<br> t3 = clock()<br> print (t3-t2)<br> print r<br><br><br>