ensure that the output of modular multiplicative inverse is positive.