human
Give me a code to compute modulus division by a power and the other steps required given the following:
Compute modulus division by a power | This function will return n % d . d must be one of : 1 , 2 , 4 , 8 , 16 , 32 , ....
Driver program to test above function.
d must be a power of 2"
Solution in Python:
assistant
#Here is code to compute modulus division by a power and the other steps required.
 def getModulo ( n , d ) :
	return ( n & ( d - 1 ) )
n = 6
d = 4
print ( n , " moduo " , d , " is " , getModulo ( n , d ) )