(x/y) mod n = ((x mod n) * (y mod n)^-1) mod n
I would like to know how to convert the above statement into python.
(x/y) mod n = ((x mod n) * (y mod n)^-1) mod n
I would like to know how to convert the above statement into python.
You can do something like this,
consider,
x=10
y=5
n=2
# You can use if condition to evaluate the expression
if (x/y)%n==((x%n)*(y%n)**(-1)):
print('Condition satisfied')
else:
print('Condition not satisfied')