mm

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 10 Imported by: 0

README

💠 mm

Simple CLI math expression evaluator.

mm uses repl to interact with user with live results and error highlighting, but immediate mode is also supported.

🧩 Get Started

Install using go install:

go install github.com/mymmrac/mm@latest

Note: Make sure to add $GOPATH/bin into $PATH

Start repl and type some expressions:

mm

> 1 + 1

> 2 ^ 8 / 3.1

> 1 / (2.5 !ceil) -

⌨ Shortcuts

  • Enter - evaluate expression
  • Up, Tab - previews executed expression
  • Down, Shift+Tab - next executed expression
  • Shift+Tab - use the result of last expression as input (only if input empty)
  • Esc - exit if input is empty, or clean input
  • Crtl+c - force quit

⚡ Operators

Binary
  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • ^ Power (only integer powers)
  • @ Nth Root (only integer roots)
  • % Mod (only integers)
Unary
  • - Minus
  • ++ Increment
  • -- Decrement
  • !abs Abs
  • !round Round
  • !floor Floor
  • !ceil Ceil

📖 Constants

  • Pi - 3.1415926...
  • e - 2.7182818...

🔐 License

mm is distributed under MIT licence.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL