comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Calculating Pi
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Calculating Pi [message #53253] Sun, 01 April 2007 10:07 Go to next message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
Does anyone have code that can calculate pi to an arbitrary
precision? This is purely an academic endeavour.

Actually that's a lie. This is just so that I can show others up.
Re: Calculating Pi [message #53328 is a reply to message #53253] Tue, 03 April 2007 00:44 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
jschwab@gmail.com wrote:
> On Apr 2, 4:09 am, Paolo Grigis <pgri...@astro.phys.ethz.ch> wrote:
>> The problem here is not one of method for computing Pi
>> (as remarked, plenty are available), but rather the lack
>> of an arbitrary precision library in IDL... (or has
>> anybody already written one?)
>>
>> Ciao,
>> Paolo
>
> There are a class of formulas called Bailey-Borwein-Plouffe (BBP) that
> let you find the nth digit, without having found the preceding ones.
> If you head to your library or Google around, I'm sure you can find
> out enough to show off to your heart's content. With double precision,
> I think that should let you get the first 10^7 digits or so.
>
> I Googled and found code examples here
> http://crd.lbl.gov/~dhbailey/expmath/bbp-codes/
>
> Cheers,
> Josiah

Yes, but these are hexadecimal digits, which you still have
to convert into decimal form... so you still need at least
one routine from the arbitrary precision library.

Ciao,
Paolo

>
Re: Calculating Pi [message #53331 is a reply to message #53253] Mon, 02 April 2007 15:04 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Sun, 01 Apr 2007 10:07:05 -0700, Braedley wrote:

> Does anyone have code that can calculate pi to an arbitrary
> precision? This is purely an academic endeavour.
>
> Actually that's a lie. This is just so that I can show others up.

I say invest in an industrial-sized box of toothpicks and lock
yourself in the tiled-floor bathroom:

http://en.wikipedia.org/wiki/Buffon's_needle

JD
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Calculating Sat. water vapor pressure from air temperature: What is wrong?
Next Topic: Re: rotate and transpose images in xobjviewer

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:51:48 PDT 2025

Total time taken to generate the page: 0.00665 seconds