John Cremona on Mon, 11 Jun 2012 14:40:44 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Set prime limit


Look at the output of default().  You can do (for example)

(13:39) gp > default(primelimit)
%1 = 500509
(13:39) gp > default(primelimit,10^7)
(13:39) gp > default(primelimit)
%2 = 10000511

and

(13:39) gp > default(parisize)
%3 = 8000000
(13:39) gp > default(parisize,10^10)
  ***   Warning: new stack size = 10000000000 (9536.743 Mbytes).
(13:40) gp > default(parisize)
%4 = 10000000000

which answers 3 out of 4 questions.

John Cremona

On 11 June 2012 13:25, Jean-Marie Madiot <madiot@gmail.com> wrote:
> Dear all,
>
> I know that I can set GP stack size both when launching gp and at runtime:
>
>  $ gp -s 12345678
>  ? allocatemem(12345678)
>
> I don't know if it's a good idea, but it's quite handy.
>
>
> 1) Is it possible to do the same for the prime limit (i.e. to run the
> sieve at runtime)?
>
> 2) Is it possible to access the prime limit at runtime?
>
> 3) Is it possible to access the stack size at runtime? (this is just
> by curiosity though)
>
> 4) Would it be possible to have a forprime() function that goes beyond
> the prime limit?
>
> I have workaround that does (4), but I need to enter the prime limit
> manually (then beyond the prime limit uses the slower isprime()) and I
> need to duplicate my code, which is often not good. (I don't suppose
> there is a preprocessor in GP, that's probably for the best.)
>
>
> Thank you,
>
> Jean-Marie Madiot
>