expression
undefined
stack
undefined
curl "https://tcpdata.com/rpn-calculator?expression=3e4%2B"
curl "https://tcpdata.com/rpn-calculator?expression=5e*"
curl "https://tcpdata.com/rpn-calculator?expression=3e4%2B5*"
curl "https://tcpdata.com/rpn-calculator?expression=10%2B&stack=%5B5%5D"
Experience the authentic Reverse Polish Notation (RPN) calculation method used by legendary HP calculators like the HP-11C, HP-12C, HP-15C, and HP-16C. RPN eliminates the need for parentheses and provides a more efficient way to perform complex calculations.
β¨οΈ HP-11C NOTATION
This calculator mimics the HP-11C keyboard behavior:
β’ Numbers: Type digits directly (e.g., "34" = thirty-four)
β’ ENTER key: Use "e" to duplicate top of stack (like pressing ENTER)
β’ Operators: +, -, *, /, % automatically push numbers and execute
β’ Example: "3e4+" pushes 3, ENTERs (duplicates to [3,3]), pushes 4 (becomes [3,4]), then adds = 7
Arithmetic: +, -, *, /, % (modulo)
Power: ^ (power), sqrt, x^2/sq (square), 1/x/recip (reciprocal)
Trigonometric: sin, cos, tan, asin, acos, atan
Hyperbolic: sinh, cosh, tanh
Logarithmic: ln (natural log), log (base 10), exp (e^x), 10^x/10x
Other: abs, neg, fact/factorial
Constants: pi (3.14159...), euler (2.71828...)
dup - Duplicate top of stack
drop - Remove top of stack
swap - Swap top two items
over - Copy second item to top
rot - Rotate top three items
clr - Clear entire stack
Traditional: (3 + 4) * 5
RPN: 3 4 + 5 *
HP-11C: 3e4+5* (e = ENTER)
Step by step for "3e4+5*":
1. Push 3 β [3]
2. ENTER (e) β [3, 3] (duplicates)
3. Push 4 β [3, 4] (replaces top)
4. Add (+) β [7]
5. Push 5 β [7, 5]
6. Multiply (*) β [35]
Square a number: 5e* (5 ENTER Γ = 25)
Cube a number: 5e5e** (5 ENTER 5 ENTER Γ Γ = 125)
Circle area (r=5): 5e*pi* (5Β² Γ Ο = 78.54)
Calculate (3+4)*5: 3e4+5* (Result: 35)
Distance formula: 3e*4e*+sqrt (β(3Β²+4Β²) = 5)
The calculator maintains a stack that persists across calculations.
Use the "stack" parameter to provide initial values:
?expression=10+&stack=[5] β Adds 10 to 5 = [15]
?expression=swap&stack=[3,7] β Swaps to [7,3]
RPN Benefits:
β’ No parentheses needed
β’ More efficient for complex calculations
β’ Natural for stack-based thinking
β’ Same method used by millions of HP calculator users
Classic HP Calculator Timeline:
β’ HP-35 (1972): First scientific pocket calculator
β’ HP-65 (1974): First programmable handheld
β’ HP-11C (1981): Legendary scientific programmer
β’ HP-12C (1981): Financial calculator (still in production!)
β’ HP-15C (1982): Advanced scientific
β‘ API FEATURES
RESTful API with step-by-step execution trace
Full stack state tracking
Comprehensive error handling
Complete HP-11C mathematical function support
β NOT YET IMPLEMENTED
The following HP-11C features are not yet available:
β’ Statistical functions: Ξ£+, Ξ£-, mean, std dev
β’ Conversions: βH.MS, βH, βRAD, βDEG, βP, βR (polar/rectangular)
β’ Percentage functions: %Ξ, %T
β’ Memory registers: STO, RCL
β’ Programming capabilities
β’ Integration functions