Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I understand that Brian was sharing a mathematical elegance with us, rather than actually trying to use PI, but since we're now headed off in that direction...

    When I need to approximate PI, I just remember the sequence [1 1 3 3 5 5], rearranging its two halves to get:

    my $PI = 355/113;

    which is correct to the first seven decimal places.

    That's sufficiently accurate to compute the circumference of the Earth from its radius with an error of about 3 metres (out of 40 million metres). Close enough for most e