Closed GoogleCodeExporter closed 9 years ago
Tried gmpy2, same.
Original comment by temp.us...@gmail.com
on 20 Apr 2013 at 7:29
I verified the behavior of GMP's mpz_invert() and it is documented to return 0.
gmpy and gmpy2 just reflect the same behavior.
gmpy.divm(a, b, m) provides a more general solution to a=bx (mod m) and divm()
does raise an exception if b is 0.
I need to think about the implications of changing the behavior of invert(). It
has had the current behavior for many years.
In any case, the SO answer should edited to use divm().
Thanks for opening the issue.
Original comment by casevh
on 20 Apr 2013 at 7:55
I changed the behavior in GMPY2 2.0.1 to raise an exception. I won't be making
any change to GMPY 1.x.
Original comment by casevh
on 28 Jul 2013 at 5:03
Original issue reported on code.google.com by
temp.us...@gmail.com
on 20 Apr 2013 at 7:27