expected behaviour of mpn_extgcd

Bill Allombert Bill.Allombert at math.u-bordeaux1.fr
Thu Oct 8 23:46:29 CEST 2009


Dear GMP developers,

GMP function mpn_gcdext(a,b) used to return the smallest u in absolute value
such that a*u+b*v=d. This is no more the case in version 4.3, for example for 
mpn_gcdext(1230460696535801497442995200,9095580234321003098716589834342400)
we expect u=1,v=0 since a divides b, but we get u=-7392011, v=0.
and unfortunately this change breaks PARI/GP.

Is this change intentional ? In that case, could the documentation clarify
what values for u are acceptable ? (The documentation terms "u" '_The_ first
cofactor' (emphasis mine) which somehow induce a French reader to expect it to
be uniquely defined. We are taught that way...).

Thanks for your answer,
Bill.
PARI/GP developer


More information about the gmp-bugs mailing list