HP-42S RPN Scientific Calculator Emulator — Full-Featured
A comprehensive browser recreation of the Hewlett-Packard HP-42S with advanced features: matrix operations, equation solver, numerical integrator, complex numbers, programming mode, full statistics, and more. All original RPN stack behavior preserved.
packard
HP-42S: Full-Featured Edition
This is a comprehensive recreation of the 1988 HP-42S with nearly all of the advanced features that made it legendary:
- Matrix Operations — Define, multiply, invert, find determinant, and solve linear systems
- Equation Solver — Find roots of any function using Newton-Raphson iteration
- Numerical Integrator — Compute definite integrals using Simpson's rule
- Complex Numbers — Full arithmetic with complex operands
- Advanced Statistics — Mean, median, standard deviation, linear regression
- Hyperbolic Functions — SINH, COSH, TANH and their inverses
- Probability — Factorial, combinations, permutations, seeded random
- Number Bases — HEX, OCT, BIN, DEC conversion modes
- Time/Angle Conversion — Convert between decimal degrees and HMS
- Programming Mode — Record keystrokes and replay as a program with labels
- Full 4-Level Stack — X, Y, Z, T with roll, swap, LAST X recovery
- 10 Memory Registers — STO and RCL into registers 0–9
Navigation: Menu System
Seven menus across the top switch the function of the soft keys:
- STD — Standard mode: basic trig, log, power, stack ops
- MATH — Hyperbolic trig, HMS↔decimal conversions
- STAT — Statistics functions and accumulators
- MTX — Matrix operations (init, multiply, solve, determinant, inverse)
- PROB — Probability (factorial, COMB, PERM, random with seed)
- CONV — Number base conversion (HEX, OCT, BIN, DEC)
- PROG — Program recorder and player
Key Features Explained
Matrix Operations (MTX menu)
INIT: Opens a dialog to define matrix size and enter values. Stores matrix A (and optionally B for operations).
A×B: Multiplies matrix A by B, pushes result to X.
DET: Computes determinant of matrix A, pushes to X.
INV: Inverts matrix A, pushes to X.
SOLV: Solves Ax = b. Stores solution vector on stack.
Equation Solver (SHIFT + SOLVE in STD)
Opens a dialog to enter a mathematical expression f(x) and an initial guess. Uses Newton-Raphson iteration to find x where f(x) = 0. Convergence tolerance is user-selectable.
Numerical Integrator (SHIFT + 1/x in STD, labeled ∫)
Computes a definite integral ∫ f(x) dx from a to b using Simpson's rule. You provide f(x) as an expression and the bounds.
Complex Numbers (i key in STD, SHIFT for CPLX mode toggle)
Enter complex numbers as pairs: press 3, ENTER, 4, SHIFT i to push 3 + 4i. Full arithmetic works on the stack: addition, subtraction, multiplication, division, trig, exponential.
Statistics (STAT menu)
MEAN: Pushes mean of accumulated data to X.
STDEV: Pushes sample standard deviation to X.
REGR: Opens linear regression dialog. Fits y = a + bx through data entered as (x, y) pairs via Σ+.
MED: Pushes median of data to X.
CLST: Clears all statistics accumulators.
Hyperbolic Trig (MATH menu)
SINH, COSH, TANH: Hyperbolic functions. Press SHIFT for inverses (ASINH, ACOSH, ATANH).
HMS ↔ Decimal Conversion (MATH menu)
D→HMS: Convert decimal degrees (or hours) in X to HMS format (H.MMSS).
HMS→D: Convert HMS format to decimal degrees.
Probability (PROB menu)
FACT: Pushes n! (factorial of X) to X.
COMB: y ENTER x COMB → C(y, x).
PERM: y ENTER x PERM → P(y, x).
RND: Generates a random number between 0 and 1, pushes to X.
SEED: Seeds the random number generator with the value in X.
Number Bases (CONV menu)
Press HEX, OCT, BIN, or DEC to switch the calculator's number base. All arithmetic continues in that base until you switch back. X is displayed and interpreted in the current base.
Programming Mode (PROG menu)
REC: Starts recording. Every key you press gets stored as a step in a program. Press REC again to stop.
RUN: Executes the recorded program from the beginning.
LIST: Shows the program steps in a dialog.
DEL: Deletes the current program.
CLR: Clears the program list (DEL confirmation).
Frequently Asked Questions
Can I use variables in the solver or integrator?
Yes. You write expressions like "x^2 - 2*x - 3" and the solver finds x; or integrate "sin(x)" from 0 to π. Variable names recognized: x, y, z, t (and mathematical constants like pi, e).
How do I enter matrix data?
Press MTX → INIT. A dialog opens asking for rows and columns. Enter the values row by row. Matrix A and B are stored separately; use A×B, DET, INV, etc., to operate on them.
What happens when I compute a complex result?
The CPLX annunciator lights up on the LCD, and X holds the result as a pair (you'll see it formatted as a + bi or similar in the display). You can continue arithmetic with complex numbers normally.
Does programming mode support branching?
Basic branching: you can record a label (LBL), and later record conditional jumps (GTO). This is a simplified version; full label/branching like the real 42S is not fully implemented, but core record/replay works.
What's the difference between REGR and the basic Σ+ accumulator?
Σ+ just tallies count, sum, and sum-of-squares for univariate stats (mean, stdev). REGR lets you accumulate (x, y) pairs and compute linear regression: slope, intercept, correlation, and predicted y-values.
