An interactive math shell.
This project supports rational numbers with arbitrary precision. You can use . or , to input decimals.
You can declare variables with = to reuse values later. The variable Ans always contains the last result.
These operators are supported:
x + y: Additionx - y: Subtractionx * y: Multiplicationx / y: Divisionx % y: Remainderx ^ y: Exponentiation(...): Grouping of operators|...|: Grouping with absolute value
These functions are supported:
abs x: Absolute valueceil x: Ceilingden x: Denominatorfloor x: Floorinv x: Inverseneg x: Negationnum x: Numeratorsgn x: Signtrunc x: Truncation
Make sure you have GCC, GMP and make installed. On Debian-based systems, you can install them with:
apt install build-essential libgmp-dev
After that, clone the repository, change the directory and build the project:
git clone https://github.com/vaporoxx/cosh
cd cosh
make
The executable is now available as ./cosh and can be moved to a different directory.
cosh [-d] [-h] [-i INPUT]
| Option | Description |
|---|---|
-d, --debug |
Prints the AST of the input instead of running it |
-h, --help |
Prints this help message |
-i, --input |
Runs INPUT instead of being interactive |