Branch: Tag:

2014-05-05

2014-05-05 15:59:31 by Martin Nilsson <nilsson@opera.com>

mpz_nextprime exists in GMP since 2009 and is about 10 times faster than our implementation.

1819:    */   static void mpzmod_next_prime(INT32 args)   { -  INT_TYPE count = 25; -  INT_TYPE limit = INT_MAX; +     struct object *o;    -  switch(args) -  { -  case 0: -  break; -  case 1: -  get_all_args("Gmp.mpz->next_prime", args, "%i", &count); -  break; -  default: -  get_all_args("Gmp.mpz->next_prime", args, "%i%i", &count, &limit); -  break; -  } +     pop_n_elems(args);       o = fast_clone_object(THIS_PROGRAM); -  mpz_next_prime(OBTOMPZ(o), THIS, count, limit); +  mpz_nextprime(OBTOMPZ(o), THIS);       PUSH_REDUCED(o);   }