Let's say you want pi to a million digits. Using a lazy list populated by the Machin's formula will take you several hours of calculation. But a hard-coded decimal representation of a million digits will take less than a megabyte of memory/disk space, even if inefficiently stored as one digit per byte and can be retrieved virtually instantly.

In practice, there's little reason to need that sort of precision. A 64-bit float has about 20 decimal digits of precision, which is enough to calculate the circumference of the Earth to less than a hair's breadth. Apparently 61 digits of pi is enough to calculate the circumference of the observable universe to within one Planck length.

In practice, floats are simply good enough for most purposes.

perl -E'sub Monkey::do{say\$_,for@_,do{(\$monkey=[caller(0)]->[3])=~s{::}{ }and\$monkey}}"Monkey say"->Monkey::do'

In reply to Re^3: Irrational numbers by tobyink
in thread Irrational numbers by grondilu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.