mpz_invert behavior -addendum
Benjamin Eltzner
b.eltzner at gmx.de
Sun Apr 13 12:26:48 UTC 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear list,
I looked at my linear algebra textbooks and found that the current
behavior of mpz_invert is indeed correct: the definition of unit is
such that it is satisfied by the element of the zero ring thus the
non-zero return value is correct. I am sorry that I was so insistent
on this and I would be grateful, if the case of the zero ring could be
treated in a separate sentence in your documentation, like:
"The element of the zero ring is a unit, therefore if op2 = +-1 the
return value is non-zero and rop = 0."
Best Regards,
Benjamin
Am 13.04.2014 12:32, schrieb Torbjorn Granlund:
> Benjamin Eltzner <b.eltzner at gmx.de> writes:
>
> To make my discomfort clearer: note that all of the following are
> "true"
>
> a) for all n: 0 * n = 0 mod 1 (rop = indef, return = 0) b) for
> all n: 0 * n = 1 mod 1 (rop = 0, return != 0) c) for all n: 1 *
> n = 0 mod 1 (rop = indef, return = 0) d) for all n: 1 * n = 1
> mod 1 (rop = 1, return != 0)
>
> I don't follow how to relate the current GMP behaviour to your
> table. To me the example a and b are the same just like c and d are
> the same. (The number after the = sign is not input to GMP, so how
> you can find different behaviour for these cases is a mystery.)
>
> I believe we always return 0 as the result of any operation in the
> zero ring. If you disagree, please show a concrete
> counter-example. In C code.
>
> I can imagine there has been a lot of discussion around this and
> you are probably tired of the issue, so I would just like to ask
> you to please update your documentation. (However, should you
> choose to reconsider, I would be very glad if you reverted the
> behavior to case a).)
>
> I believe the current behaviour is mathematically correct. The
> behaviour of older GMP was not mathematically correct in the zero
> ring.
>
> I agree that there is a slight documentation problem for mpz_invert
> wrt the zero ring.
>
> Torbjörn Please encrypt, key id 0xC8601622
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
iQIcBAEBAgAGBQJTSoJ8AAoJEK27BRz67lmpRvsP/0RINMPA86bNfqknhk2p5Q1h
SGjSjNmkMMhbloRDfW6ixw2p5yZ7cduNY3r9qYc89aQsiZx84daLU6HzKWGOOp1Z
kcbunqtSMROtm98ZrDe5zUYQS0OVCxehhE+kwqxDEgaW4/o2IYI5V5NL5+8dlHfD
akoO3Qo7OM15MJvU8Dnu1jJNuGOlbyN3GpLdjY1oXXvRyLtMdEjNjhjkfkcuJiRd
bAEHp1J7sj4E+UxMRfj9CKjJsDxXeWVEi8KDw9hEQR5QWDQueXTmU6pVCpBnCtDV
ZOjvVFtAdyqoPnTKLWjQq/HjkycI68tLQTCYpMWHi5lyACEqTy4gKfqAaiupZVoj
TEwvI1KwhmM2MpulChaneF14mP24Zh9SYrx2PoxNttjhyUyz+eua/otSlkJ7yXOZ
3NBHutczo3cmrih4gpCaaNK0vxb7A15mKMOfBGA8nCc3LfudgXVG8Gw8c1Qp/Izo
OrcVqbJOLb/S1EP6RqM3zA4DG1DsfWJ3Ogb0pJcUpzG71ivatRmTVtsz2TXTmYcj
gZ3Obg/zLHpMlH0vSSMdHHs/690wGsdJsU6TMS+tCrHRvARayafIc90sMHcwuQM/
IfWBIRAhqLRpug7OYfWcyryipKNGwN5yn7O8MsCnzrS1CfIhKInjiimcr6YEaJR7
iqsQAMPfXL2Mtbx24gus
=i2uE
-----END PGP SIGNATURE-----
More information about the gmp-bugs
mailing list