if (z.compareTo(BigInteger.valueOf(0)) <= 0) {
// Handle negative modulo's specially
/*if (z.compareTo(BigInteger.valueOf(0)) == 0) {
throw Py.ValueError("pow(x, y, z) with z == 0");
}*/
y = value.modPow(y, z.negate());
if (y.compareTo(BigInteger.valueOf(0)) > 0) {
return Py.newLong(z.add(y));
} else {
return Py.newLong(y);
}