Bill Allombert on Thu, 6 Jun 2002 15:31:40 +0200


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

Re: lex() feature


On Sat, Jun 01, 2002 at 06:52:33PM +0100, Jon Perry wrote:
> Is pi(n) a Pari/GP feature? (count number of primes to n)?
> 
> I came up with:
> 
> pi(n)=local(i,pic);pic=0;forprime (i=1,n,pic++);pic;
> 
> but I would have thought this would have been a Pari standard.

In the development version 2.2.x you can do
install("pith","L",pi)
to get the same function, only faster.

It is not yet in GP, mainly because I am not sure how to name it.
Having  both pi and Pi is confusing, especially since old GP was
case insensitive.

Cheers,

Bill.