Version 4.1.4: gmp_printf() fails.

Henrik Johansson mhrkjohansson at gmail.com
Tue Jan 31 15:39:44 CET 2006


The following program fails with a "Segmentation fault" when compiled
and run on both a cygwin and a debian system.
------------------------------------------
#include <stdio.h>
#include <gmp.h>

int
main(int argc, char *argv[])
{
  mpz_t res;

  mpz_init_set_ui(res, 1);
  mpz_mul_2exp(res, res, 30402457);
  mpz_sub_ui(res, res, 1);
  gmp_printf("%Zd", res);
  mpz_clear(res);

  return 0;
}
------------------------------------------

/hj

--
Henrik Johansson, +46(707)364599


More information about the gmp-bugs mailing list