diff options
author | Niels Möller <nisse@lysator.liu.se> | 2011-05-17 23:05:59 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2011-05-17 23:05:59 +0200 |
commit | d02dbf156c32359f4896301cd5539ef58e60a6ba (patch) | |
tree | b40dcf227023de2eaf77cc5b83aa6ed692690f4e /doc/gmp.texi | |
parent | 124aa18e5860108e54ddfe774852e8a344ccdea3 (diff) | |
download | gmp-d02dbf156c32359f4896301cd5539ef58e60a6ba.tar.gz |
Clarify input requirements for mpn_gcd and mpn_gcdext
Diffstat (limited to 'doc/gmp.texi')
-rw-r--r-- | doc/gmp.texi | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/gmp.texi b/doc/gmp.texi index 5e50d4ecb..e43ce6b3e 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -5357,10 +5357,9 @@ Set @{@var{rp}, @var{retval}@} to the greatest common divisor of @{@var{xp}, the return value is the actual number produced. Both source operands are destroyed. -@{@var{xp}, @var{xn}@} must have at least as many bits as @{@var{yp}, -@var{yn}@}. @{@var{yp}, @var{yn}@} must be odd. Both operands must have -non-zero most significant limbs. No overlap is permitted between @{@var{xp}, -@var{xn}@} and @{@var{yp}, @var{yn}@}. +It is required that @math{@var{xn} @ge @var{yn} > 0}, and the most significant +limb of @{@var{yp}, @var{yn}@} must be non-zero. No overlap is permitted +between @{@var{xp}, @var{xn}@} and @{@var{yp}, @var{yn}@}. @end deftypefun @deftypefun mp_limb_t mpn_gcd_1 (const mp_limb_t *@var{xp}, mp_size_t @var{xn}, mp_limb_t @var{ylimb}) @@ -5376,7 +5375,8 @@ Compute the greatest common divisor @math{G} of @math{U} and @math{V}. Compute a cofactor @math{S} such that @math{G = US + VT}. The second cofactor @var{T} is not computed but can easily be obtained from @m{(G - US) / V, (@var{G} - @var{U}*@var{S}) / @var{V}} (the division will be exact). It is required that -@math{U @ge V > 0}. +@math{@var{un} @ge @var{vn} > 0}, and the most significant +limb of @{@var{vp}, @var{vn}@} must be non-zero. @math{S} satisfies @math{S = 1} or @math{@GMPabs{S} < V / (2 G)}. @math{S = 0} if and only if @math{V} divides @math{U} (i.e., @math{G = V}). |