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 = clock()
    r = x>>n
    t3 = clock()
    print (t3-t2)
    print r
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to