MUMBAS
0
Q:

pow mod python why faster

# Fast python code that first calls pow()  
# then applies % operator 
a = 2
b = 100
p = (int)(1e9+7) 
  
# Using direct fast method to compute  
# (a ^ b) % p. 
d = pow(a, b, p) 
print d 
0

New to Communities?

Join the community