Define a procedure mod(m, n)
, which returns m mod n, where both arguments are positive integers. Don’t use %. Your function should have type (positiveInt, positiveInt) -> positiveInt
import math
def mod(m, n):
num = m/n
if type(num) == float:
return m - math.floor(num) * n
else:
return n