Bill Allombert on Tue, 14 Jan 2003 15:17:47 +0100

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

Re: Pi

On Sun, Jan 12, 2003 at 06:07:00PM +0100, Ralf Stephan wrote:
> The manual says (p.69) a copy of Pi is created on the heap for quicker
> computations next time the function is called. This does not seem
> to be true in 2.2.4 as with both \p 12000 and 12200, Pi needs about
> one second here (I know it's fast enough but the manual says it).

If it is your question, there is no incremental algorithm to compute Pi
implemented.  Computing Pi at 12200 d.p does not use the knowledge of the first
12000 d.p.

I do not know if it would make sense to do that.

However caching is implemented so that computiong Pi a second time at the same
precision or a lower precision is instantaneous.  The cached value is stored in
the heap, but the mppi() function provide a copy on the stack as well.