in reply to
Re: Irrational numbers

in thread Irrational numbers

It might indeed have a big cost in performance, though it's not so obvious. When adding two real numbers, there would be no computation whatsoever until an actual approximation of the result is requested. It could require lots of memory though, since there is a creation of a new closure (with all its context) for each arithmetic operation.

« Another is: how would you ever decide when to stop calling for more digits... »

This really is not an issue. It's like entering a drugstore and complaining about how there is too much choice. Accuracy would only affect numerical comparison and approximations. You can use a fixed value if you want. It depends on what you want to do with your numbers. The important thing is that it won't affect the way the calculations are done. Or in other words, it won't affect the result, only the way you show it.

Say you have a spaceship in a circular orbit around the sun with about an hundred thousands of millions of meters radius. That's about 150e9 meters. And you want to compute the position to a precision of the millimiter, because you worry about space debris for instance, or because you need to do some very advanced docking, or whatever). That would involve using angles as small as 6e-15 radians. So you'll need about 15 decimals of pi for you calculations. You wouldn't have to worry about that with an exact definition of pi. You would just make the calculations, and request a result with a millimeter precision. At no point you would have to worry about changing the definition of pi.

Comment on
Re^2: Irrational numbers
Replies are listed 'Best First'. | |
---|---|

Re^3: Irrational numbers by BrowserUk (Pope) on Dec 18, 2012 at 10:13 UTC | |

- Re^4: Irrational numbers
by grondilu (Pilgrim) on Dec 18, 2012 at 12:27 UTC | |

- Re^5: Irrational numbers
by BrowserUk (Pope) on Dec 18, 2012 at 13:18 UTC | |

- Re^6: Irrational numbers
by grondilu (Pilgrim) on Dec 18, 2012 at 14:05 UTC | |

- Re^7: Irrational numbers
by BrowserUk (Pope) on Dec 18, 2012 at 15:16 UTC | |

Re^3: Irrational numbers by tobyink (Abbot) on Dec 18, 2012 at 10:20 UTC | |

Re^3: Irrational numbers by Anonymous Monk on Dec 18, 2012 at 15:05 UTC | |

- Re^4: Irrational numbers
by BrowserUk (Pope) on Dec 18, 2012 at 16:04 UTC |

In Section
Meditations