mpz_gcd_ui documentation

Max Horn max at
Sun Jan 1 23:00:33 UTC 2017

Hi again,

here is yet another thing in the GMP documentation I found confusing,
this time for mpz_gcd_ui. The docs day:

 "If the result does not fit, 0 is returned, and the result is equal to the argument op1."

It took me a moment to realize that this case can only occur if op2 is 0; without that
realization, I first thought "op1" was a typo and should be "rop". While it's certainly
not difficult to figure it out,  I believe the documentation would be better by
explicitly pointing this out, e.g. by saying

"If the result does not fit, which can only happen when op2==0, then [...]"


More information about the gmp-bugs mailing list