mpz_gcd_ext(NULL, ...)

Torbjörn Granlund tg at
Fri Nov 25 15:41:38 UTC 2016

nisse at (Niels Möller) writes:

  tg at (Torbjörn Granlund) writes:
  > I suppose it also implies a slight computation overhead
  > to check size + low limb for the return value.
  Slight enough to be reasonably for the mpz-layer, I think. 
Yep, something akin to

  return gp[0] | gn;

should do, since we can surely assume gp[0] is valid.

  One could consider doing that only when the gcd pointer is NULL, and
  otherwise return some arbitrary value. But that's not a pretty
  interface to document...
For mpn I think such neat interfaces are conceivable, but not great.

Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list