The function mpz_invert computes inveses modulo an integer, or returns
an error indication when fed with a divisor of zero.

The current code handles the zero ring (i.e., modulo 1) specially and
considers no integer to be invertible.

Is that correct?  We're considering to change this behaviour.

The argument is that an inverse of a is definied to exist is ab = 1 for
some b.  In this ring 0 = 1 and thus are all integers congrent with 0.
We have ab = 0 = 1 for any a and b.  Thus any integer is invertible in
this ring.

Please speak up if you disagree.

Torbjörn

_______________________________________________
gmp-devel mailing list
[email protected]
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to