Certain irrational numbers have a compact but useful representation; for example the square-root of two can be represented as bless(\'2 ** 0.5', 'Surd'). A suitably smart implementation of the Surd class could figure out that root-2 times 3-root-2 equals 6 without resorting to floating point arithmetic.
The problem with π is that it's not just irrational; it's transcendental. There's no convenient, accurate representation of it. You've just got to store an approximation as a float or string or whatever, and it will only be accurate to a certain number of decimal places.
In reply to Re: Irrational numbers
by tobyink
in thread Irrational numbers
by grondilu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |