formula to calculate modulus - Search