The result of a ^ 0 mod -1 is 0 not 1