py: Implement raising a big-int to a negative power.

Before this patch raising a big-int to a negative power would just return
0.  Now it returns a floating-point number with the correct value.
This commit is contained in:
Damien George
2017-07-25 11:49:22 +10:00
parent 4d1fb6107f
commit 04552ff71b
5 changed files with 19 additions and 4 deletions

View File

@@ -946,10 +946,6 @@ bool mpz_is_pos(const mpz_t *z) {
return z->len > 0 && z->neg == 0;
}
bool mpz_is_neg(const mpz_t *z) {
return z->len > 0 && z->neg != 0;
}
bool mpz_is_odd(const mpz_t *z) {
return z->len > 0 && (z->dig[0] & 1) != 0;
}