Convert a number to base 173

Di Maria Giovanni calimero22 at
Sun May 20 22:03:08 CEST 2012

Can you help me to translate a number TO base 173 ?
Using the low leve function  "mpn_get_str", if the limb is 1, it works fine.
But if the limb is greater tha 1, it does not work.
Here is my code.

#include <stdio.h>
#include <malloc.h>
#include <gmp.h>
int main(void)

   int k;

   mpz_t ru;
   unsigned char *v;
   mp_limb_t indirizzo;
   mp_size_t lunghezza,bytes_scritti;




   for(k=0;k<=bytes_scritti-1;k++) {

      printf("%d ",v[k]);

   return 0;

I Repeate:  If the number is stored in a limb, it's OK. More limb give problems.
Please Help me!..

Thank you

More information about the gmp-discuss mailing list