Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Seaus-tech/Calculator-App/llms.txt

Use this file to discover all available pages before exploring further.

Calculator App is a Python-powered terminal calculator that goes far beyond basic arithmetic. Installed as a single pip package and launched with the calc-app command, it gives you an interactive REPL where you can crunch numbers using plain English, work with fractions, solve linear equations, store named variables, call math functions, and even toggle a meme mode for comic relief — all without leaving your terminal.

Features at a Glance

Calculator App ships with a broad set of capabilities out of the box:
  • Basic arithmetic — addition, subtraction, multiplication, division, and exponentiation with correct operator precedence
  • Natural language input — phrases like 9 squared, 5 cubed, and sqrt of 16 are parsed and evaluated automatically
  • Fraction arithmetic — enter 1/2 + 1/3 or mixed numbers like 2 1/2 + 3/4 and get exact fractional results
  • Equation solving — write 2x+4=10 or 6+x=7 and the solver finds the unknown variable
  • Named variables — set x=5 and then reuse x in any subsequent expression
  • Math functionssqrt, sin, cos, tan, log, and constants pi and e are available by default
  • Meme mode — type meme to toggle on a layer of internet humour over your results

Explore the Features

Basic Math

Arithmetic expressions with full operator precedence and exponentiation.

Fractions

Exact fraction and mixed-number arithmetic powered by Python’s Fraction type.

Natural Language

Type expressions in plain English: squared, cubed, sqrt of, and more.

Variables

Store values with x=5 and reference them in any later expression.

Equation Solver

Solve linear equations like 2x+4=10 directly at the prompt.

Math Functions

Built-in access to sqrt, sin, cos, tan, log, pi, and e.

Meme Mode

Toggle meme mode with meme for humorous takes on your calculations.

How It Works

Calculator App runs as a REPL (Read-Eval-Print Loop). Each time you press Enter, the app reads your input line and routes it through a processing pipeline:
  1. Natural language parser (parser.py) — rewrites English phrases into Python-compatible expressions (e.g. 9 squared(9)**2).
  2. Fraction parser (fractions.py) — converts fraction literals and mixed numbers into Fraction(...) constructor calls so arithmetic stays exact.
  3. Evaluator (evaluator.py) — substitutes any stored variable names with their current values, then calls Python’s eval against a tightly controlled safe namespace that exposes only the math functions listed above, preventing arbitrary code execution.
  4. Equation solver (solver.py) — when the input contains both = and a letter, the solver isolates the unknown and returns its value instead of routing through the evaluator.
  5. Meme handler (meme.py) — when meme mode is active, a small set of well-known inputs are intercepted and returned with comedic results before the evaluator runs.
The loop continues until you type quit or press Ctrl+C.
Calculator App requires Python 3.10 or later. Make sure your environment meets this requirement before installing. You can check your version with python --version.

Build docs developers (and LLMs) love