mpz_invert (x, 1, 0)

Torbjorn Granlund tg at gmplib.org
Fri Mar 2 10:38:40 CET 2012


If we consider the ring Z, and note that Z mod n is isomorphic to (some
would say identical to) Z/nZ, letting n = 0 will quote with the zero
ideal (0Z = {0}), leaving Z (or more accurately, leaving the set of
congruence classes {{0}, {1}, {2}, ...} with just one element per class.

I agree with Jörg: Z is isomorphic to Z/0Z.

I am more concerned with not adding extra tests on existing critical
paths than with defining corner cases that nobody will probably use.

Therefore, a series of disjoint unlikely conditions is not good.  If
they can be combined to few disjoint unlikely conditions (possibly
covering some unlikely case too much, to be rejected later) that I am
much happier.  Unfortunetely, the change to invert adds such unlikely
critical-path conditions.

-- 
Torbjörn


More information about the gmp-devel mailing list