change limb size

Olivier Ruatta Olivier.Ruatta at sophia.inria.fr
Mon Jun 7 16:51:53 CEST 2004


Hello,

I want to change the size of the limb of natural numbers representation. 
I use the code above and nothing change. Does someone can explain me 
what I misunderstoud ?
Thanks in advance,
Olivier.

/* The file is compile with the following command :
* gcc -I/usr/local/lib/gmp-4.1.2/include -L/usr/local/lib/gmp-4.1.2/lib  fex.c -o fex.ex -lgmp */

#include <stdio.h>
#include <gmp.h>

#undef  mp_bits_per_limb
#define mp_bits_per_limb 2 //here you can change 2 for everythings you ant, nothing change



int main(int argc, char **argv)
{
  printf("%d \n",mp_bits_per_limb);
  mp_size_t ns = 40;
  mp_limb_t n[40]; 
  mpn_random(n,ns);
  gmp_printf("n = %Nx \n",n,40);
  gmp_printf("n = %Nx \n",n,20);
  mp_limb_t m[1];
  *m = n[1];
  gmp_printf("m = %Nx \n",m,1);
  return 1;
}
-- 
Olivier Ruatta  
U.N.S.A.- I.N.R.I.A. Sophia-Antipolis
olivier.ruatta at sophia.inria.fr
http://www-sop.inria.fr/galaad/personnel/ruatta/



More information about the gmp-discuss mailing list