RPN Scientific Calculator II

exact · complex · arbitrary precision John B. Wilson · scirealm.org
— 30 digits rad base 10 depth 0

Functions

click a name to apply it to the stack

Tape

click a line to reuse its result

Keypad

digits type into the line

Modes

Memory

Unit converter

converts the input line, or the top of the stack

Polynomial roots

complex coefficients welcome

Linear system

exact if every entry is exact

How it works

click to collapse

Two kinds of number

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.

Entering values

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/_60polar: modulus 2, angle 60 in the current angle mode
ff_b16, 0xff, 0b1011other bases (2 to 36)
{1;2;3}a list, for the statistics functions
1e100exact when the exponent is a whole number

Keyboard

  • Enter evaluate and push · Esc clear the line
  • Backspace on an empty line drops the top of the stack
  • Ctrl+Z undo · Ctrl+Shift+Z redo
  • Alt+U dup · Alt+D drop · Alt+S swap

Things worth trying

1000!2568 digits, exact, instantly
factor(2^67-1)the factorization that undid Mersenne’s guess
2^4423-1 IsPrimea 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

Notes on precision

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.

Stack

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.