In iteger arithetric divsion is no the oposite of multiplication. As pointed out (9 / 4) * 4 = 8 Why? 9 / 4 = 2 2 * 4 = 8 To achive a inverse you need to use the modulo as well so: 9/4 = 2 9 %4 = 1 and (9/ 4) *4 + (9%4) = 9