Skip to content

rockworm/rpncalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPN Calculator

A terminal-based Reverse Polish Notation calculator built with Rust and Ratatui.

Features

  • Arithmetic: +, -, *, /, ^, %
  • Logarithmic: ln, log, exp, 10x
  • Math Functions: sqrt, cbrt, abs, root, inv (1/x), ! (factorial)
  • Constants: pi, e
  • Trigonometry: sin, cos, tan, asin, acos, atan
  • Stack Operations: swap, drop, clear, undo
  • Interactive TUI with stack visualization and calculation history

Usage

cargo run

Controls

  • Type numbers and press Enter to push to stack
  • Type commands and press Enter to execute
  • Single-character operators (+, -, *, /, ^, %, !) execute immediately
  • q to quit, help for command list, Esc to clear stack

Example

Input: 5 4 +
Stack: [9]

Input: 3 *
Stack: [27]

Installation

git clone <repo-url>
cd rpncalc
./install.sh

Or for user-only installation:

cargo install --path .

Testing

cargo test

Requirements

  • Rust 1.70+
  • Terminal with Unicode support

About

Rpn calculator with a (hopefully) simple TUI

Resources

Stars

Watchers

Forks

Packages

No packages published