Genii Weblog

Happy Pi Day!

Wed 14 Mar 2007, 10:41 PM



by Ben Langhinrichs
Inline JPEG image
Pies, Pies, Pies by Wayne Thiebaud

For those who don't know, today is Pi Day (or π Day for those who like their symbols), so named because it is 3/14 (at least here in the U.S.), which neatly corresponds to 3.14, the first few digits of pi.  The traditional way to celebrate is by having some pie, the yummy kind.  We had Dutch Apple and Key Lime pies in my house.

Incidentally, when I was about thirteen, I memorized the first 26 digits of pi.  Let's see if I still remember:  3.14159265358979323844626433....  I don't have time to check right now, but that sounds about right.

Copyright © 2007 Genii Software Ltd.

What has been said:


569.1. Ben Langhinrichs
(03/15/2007 04:43 AM)

Ian - Thanks. Glad to see that some part of my mind has not decayed into nonrecognition yet. As for the 4 million places, I'm glad I can look them up and don't need to try to memorize those.


569.2. Mika Heinonen
(03/15/2007 10:23 AM)

I see often that people make PI as a constant in their programs. I think a better solution is to use the computer's maximum floating point accuracy and use simply: double PI = 4*Atn(1)

Atn() stands for Arcus Tangens in Radial mode, also seen often as atan() or arctan().

Most compilers have PI already declared, and usually it's defined also using the maximum precision.