Simple multiply example for a low level (mpn_) function

Niels Möller nisse at lysator.liu.se
Mon Jan 12 08:30:04 CET 2004


"Peter Hicks" <trick at satlink.com.au> writes:

>     mpn functions are notoriously hard to use. Can I have a simple multiply example for 16*16.

  mp_limb_t a[16];
  mp_limb_t b[16];
  mp_limb_t c[32];
  
  ... store some values in a and b...
  
  /* Compute c = a * b */
  mpn_mul_n(c, a, b, 16);

/Niels


More information about the gmp-discuss mailing list