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

RE: [MacPerl] pi, slightly off topic



> >My G3 300MHz (drooling) Laptop 
<insert "envy.h">


> loses precision after -
> >
> ># 3.1415926535897931159979634685441851615905761718750
> >printf ("%.50f", atan2(1,1) * 4.0);
> 
> Actually only accurate to 15 digits.  Still, this is precise 
> enough for 
> most applications.

One of the more interesting quotes I found when I was researching how to
figure the value of pi was this, from mathematician Hermann Schubert:

Conceive a sphere constructed with the earth at its center, and imagine its
surface to pass through Sirius, which is 8.8 light years distant from the
earth [that is, light, traveling at a velocity of 186,000 miles per second,
takes 8.8 years to cover this distance]. Then imagine this enormous sphere
to be so packed with microbes that in every cubic millimeter millions of
millions of these diminuitive animalcula are present. Now conceive these
microbes to be unpacked and so distributed singly along a straight line that
every two microbes are as far distant from each other as Sirius from us, 8.8
light years. Conceive the long line thus fixed by all the microbes as the
diameter of a circle, and imagine its circumference to be calculated by
multiplying its diameter by pi to 100 decimal places. Then, in the case of a
circle of this enormous magnitude even, the circumference so calculated
would not vary from the real circumference by a millionth part of a
millimeter.

This example will suffice to show that the calculation of pi to 100 or 500
decimal places is wholly useless.

But just because it's useless doesn't mean it's not worth doing. The same
page has this quote from Pitr Beckmann:

For the most part, I suspect, that driving force behind these calculations
was the spirit that makes people go over Niagra Falls in a barrel or to top
the world record of pole sitting by another 20 minutes.

Anyway, I tried the same program mentioned above on this computer running NT
4.0 with ActivePerl:

C:\> perl -e "printf (qq(%.50f),atan2(1,1) * 4.0);"
3.14159265358979310000000000000000000000000000000000

same degree of accuracy, 15 digits. On Linux 2.2.5 with Perl 5.005_02 (hm,
time to upgrade):

[08:55 creede:~]$ perl -e "printf (qq(%.50f),atan2(1,1) * 4.0); print
qq(\n);"
3.14159265358979311599796346854418516159057617187500

same as MacPerl. Hm, well, there goes the idea of using ActivePerl to check
Schubert's assertion.

-- Creede



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org