Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

RPN Calculator

Result

(empty stack)

Stack (bottom → top)

empty

Usage

Reverse Polish Notation: operands first, operator last.

  • Push("5") then Push("3") then Push("+")8
  • Supported operators: +, -, *, / (integer division)
  • An operator pops the top two values (a, b) and pushes a op b.
  • Clear() empties the stack.
  • Divide-by-zero and underflow abort the transaction.