Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^3: Irrational numbers

by tobyink (Abbot)
on Dec 18, 2012 at 08:35 UTC ( #1009309=note: print w/replies, xml ) Need Help??

in reply to Re^2: Irrational numbers
in thread Irrational numbers

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'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009309]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-07-23 08:53 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (346 votes). Check out past polls.