mpz_out_str seg fault with large number = bug?

Torbjorn Granlund tege at swox.com
Thu Aug 4 01:48:29 CEST 2005


viny at adinet.com.uy writes:

  While I was checking the performance of the mpz_fac_ui in gmp 4.1.4 in a
  redhat, I become aware that mpz_out_str aborts with segmentation fault for
  large numbers.
  
  like this:
  
  ...
  mpz_init(c);
  mpz_fac_ui(c,1000000L);
  mpz_out_str(stdout,10,c);  //ok without this, but seg fault if included
  mpz_clear(c);
  ...
  
  
  
  I also noticed that mpz_fac_ui also seg faults if the parameter is as big
  as 10000000L
  
  
  Is there any documentation about the admisible range of those functions?
  
Please see http://swox.com/gmp/#FAQ.

-- 
Torbjörn


More information about the gmp-discuss mailing list