Every value on the stack is either exact — an arbitrary-size
integer, a fraction, or a complex number whose parts are fractions — or a
float carried to the working precision you choose, up to 1000 digits.
Arithmetic stays exact for as long as it can: 2 3 / is 2/3, not 0.6666…,
and 0.1 + 0.2 is 3/10. A function that cannot be exact, such as
sin or ln, converts to a float at that moment. ToExact and
ToFloat move a value across by hand.
| 2 3 + | RPN: separate the tokens with spaces |
| 2+3*sin(pi/4) | ordinary algebra also works |
| (3,4) | complex pair, same as 3+4i |
| 2/_60 | polar: modulus 2, angle 60 in the current angle mode |
| ff_b16, 0xff, 0b1011 | other bases (2 to 36) |
| {1;2;3} | a list, for the statistics functions |
| 1e100 | exact when the exponent is a whole number |
Enter evaluate and push · Esc clear the lineBackspace on an empty line drops the top of the stackCtrl+Z undo · Ctrl+Shift+Z redoAlt+U dup · Alt+D drop · Alt+S swap| 1000! | 2568 digits, exact, instantly |
| factor(2^67-1) | the factorization that undid Mersenne’s guess |
| 2^4423-1 IsPrime | a 1332-digit Mersenne prime, tested by BPSW |
| modpow(3, 2^100, 10^30+57) | modular power with an astronomical exponent |
| gaussfactor(5+3i) | factoring in the Gaussian integers |
| zeta(0.5+14.134725141734693i) | the first non-trivial zero |
| contfrac(pi) | 3, 7, 15, 1, 292, … |
| decimal(1/17) | the exact repeating expansion |
| tofracn(pi, 1000) | 355/113 |
| sqrt(-1) | exactly i — the true test of a calculator |
| 1000 digits, then pi | π to a thousand places |
Floats are binary, carried with guard bits and rounded for display, so what you see is trustworthy to the digits shown — every function here has been checked digit by digit against an independent arbitrary-precision library at 30, 100, 200, 500 and 1000 digits. ζ is the slow one: a thousand digits of ζ(3) takes about twenty seconds. Values keep the precision they were computed at: raising the precision setting affects new work, not old results — recompute to get more digits. Elementary functions, Γ, ψ, ζ, erf, W, AGM and the elliptic integrals are all evaluated at the working precision.
The bottom line is register x, the top of the stack. A function takes its arguments
from the stack in the order you entered them, so 3 4 Sub gives −1.
Anything left on the input line is pushed first, so typing 4 and pressing
Sqrt works the way you expect.