When the calculator displays the digits of $\pi$, how does it arrive at that answer? Also, at what digit does the approximation of $\pi$ stop at?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I'm not an expert in calculators, but here's my understanding: The calculator doesn't calculate $\pi$. It has a numerical approximation programmed in, up to some degree of precision which is almost certainly more than the number of decimal places that fit in the display. Then it treats $\pi$ like any rational constant. If you want to see how far your calculator goes, here's what you can do:
First, enter $\pi$ into your calculator. Subtract 3. Multiply by 10. Subtract 1. Multiply by 10. Subtract 4, multiply by 10, subtract 1, multiply by 10, etc, getting rid of more and more digits. Eventually you'll run out of digits, get 0, or hit some other other sort of error. If you keep track of how many steps this takes, you'll find out how many digits of $\pi$ your calculator has "memorized."
There's a difference between idealized mathematics and the real world calculations which require definite answers of some precision (significant digits), $\pi$ is not only irrational, it is transcedental. The computer resoloves down to a $n$-bit approximation, which is mostly impeded only by register size and the actual design of the microprocessor that powers it. It is simply a constant floating point value of varying bit-depth and is treated as such.
You can do lots of clever tricks and processing, creating huge-digit numbers which can be intrepreted by the software in terms of multiple bytes banded together ( even though it crosses register size ). But at the end of the day, every attempt to have $\pi$ naturally in the system, as an irrational and transcendental constant it is, is impossible. Computers are fundamentally deterministic and finite.
The precision varies from financial calculators, home calculators to scientific calculators. Also, defer back to hardmath's comment, CORDIC routines are interesting when the given implementation of a calculator doesn't have a hardware multiplier.
In the end: It is represented as a finite constant approximation of varying bit-depth depending on the platform it is implemented on and stored in the varying size ROM. Example, iPhone's Calculator PI constant is at around ~17 digits (bear in mind that the architecture of the iPhone is much more complex than a calculator and the representation of $\pi$ could be a lot better if you implemented it yourself using clever programming).