A modern CLI calculator
cargo install --git https://github.com/mosmeh/beek| Operators | Description |
|---|---|
+ |
addition |
- |
subtraction |
*, ·, ×, whitespace |
multiplication |
/, ÷ |
division |
% |
modulo |
^, ** |
exponentiation |
! |
factorial |
Precedence and associativity (ordered from highest precedence to lowest):
| Category | Operators | Associativity |
|---|---|---|
| factorial | ! |
left |
| exponentiation | ^, ** |
right |
| multiplication | whitespace | left |
| multiplication | *, ·, ×, /, ÷, % |
left |
| addition | +, - |
left |
abs, acos, acosh, asin, asinh, atan, atan2, atanh, cbrt, ceil, cos, cosh, degrees, erf, erfc, exp, floor, fract, gamma, hypot, lgamma, ln, log, log10, log2, max, min, pow, radians, random, round, sign, sin, sinh, sqrt, tan, tanh, trunc
| Command | Description |
|---|---|
help, ? |
show help |
list, ls, ll |
list constants, variables and user-defined functions |
delete, del, rm variable/function ... |
delete variable(s) or function(s) |
reset |
reset environment |
clear, cls |
clear screen |
quit, exit |
quit |
> mass = 5; velocity = 3
> energy = mass * velocity^2 / 2
= 22.5
> binomial(n, k) = n! / k! / (n-k)!
> binomial(5, 3)
= 10
e,π(pi) andτ(tau)ansand_store the last result
beek's web version is made with WebAssembly. The following commands will build the Rust codes, convert them to WebAssembly, and opens the web version in the browser.
npm install
npm startTo build the web version with optimizations enabled, run:
npm run build