Simple CLI math expression evaluator.
mm uses repl to interact with user with live results and error highlighting, but immediate mode is also supported.
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 / ceil(2.5 + 4 / (abs(sin(5))))
Enter
- evaluate expressionUp
,Tab
- previews executed expressionDown
,Shift+Tab
- next executed expressionShift+Tab
- use the result of last expression as input (only if input empty)Esc
- exit if input is empty, or clean inputCrtl+c
- force quit
+
Addition-
Subtraction*
Multiplication/
Division//
Floor division^
Power%
Modulo
+
Plus-
Minus
sqrt/1
Square rootabs/1
Absolute valueround/1
Round to integerround/2
Round with precisionroundUp/1
Round up to integerroundUp/2
Round up with precisionfloor/1
Floorceil/1
Ceilsin/1
Sinecos/1
Cosinetan/1
Tangentatan/1
Arc tangentrad/1
To radiansmin/2
Minimummax/2
Maximumrand/0
Random value [0, 1)
Note:
<name>/N
means that<name>
is called withN
arguments
Pi
- 3.1415926...e
- 2.7182818...
mm is distributed under MIT licence.