Calculator REPL with syntax highlighting, persistent history, and mathematical functions similar to bc(1)
eva is a command-line calculator REPL that provides an interactive mathematical computation environment similar to bc(1). It supports standard arithmetic operations, trigonometric functions (sin, cos, tan, etc.), logarithmic functions, and mathematical constants like pi and e. The calculator includes both binary operators (+, -, *, /, ^, **) and unary operators, with trigonometric functions expecting input in degrees by default.
The tool offers several quality-of-life features that enhance the calculation experience. It automatically inserts multiplication operators where needed (e.g., "12sin(45)" becomes "12 * sin(45)"), balances parentheses automatically, and allows referencing the previous result using "_". Eva provides syntax highlighting for mathematical expressions and maintains persistent history across sessions.
eva can operate in two modes: as an interactive REPL for ongoing calculations, or in command mode by passing expressions as arguments. It supports customizable output formatting with configurable radix (base 1-36) and decimal precision (1-64 places), plus an optional radian mode for trigonometric calculations. The tool targets developers, students, and anyone needing a feature-rich command-line calculator with mathematical function support.
# via Homebrew
brew install eva
# via Cargo
cargo install eva
