limit on number of digits when printing?

ami ... amidamaru_swe at yahoo.se
Fri Sep 3 17:56:23 CEST 2004


Hi!

There seems to be an upper limit on the possible
number of digits during output.

Consider this program:
//===========================================
#include <stdio.h> 
#include <gmp.h> 

int main() { 
  mpz_t m; 
  mpz_init(m); 
  mpz_setbit(m, 1000000);
  mpz_out_str (stdout, 10, m) ; 
  
  //no problem printing this one...
  
  printf("\n\n");

  mpz_setbit(m,10000000);
  //works fine up to here

  mpz_out_str(stdout, 10, m);
  //this is where the program ends with a stack
overflow or something.

  mpz_clear(m);
return 0; 
} 
//======================================

The same thing happens when I try to write to a file.
Is there some way to get around this?

I've compiled gmp in mingw with the following
configuration:

./configure --disable-shared --enable-static
--enable-alloca=yes 

as well as: 

./configure --disable-shared --enable-static
--enable-alloca=malloc-notreentrant

and finally 

./configure --disable-shared --enable-static
--enable-alloca=malloc-reentrant

/ami


Höstrusk och grå moln - köp en resa till solen på Yahoo! Resor på adressen http://se.docs.yahoo.com/travel/index.html


More information about the gmp-discuss mailing list