This is a command line program that behaves as a calculator, evaluating simple mathematical expresions on numbers of arbitrary precision while relying solely on C standard libraries.
To build the executable you will need CMake. While in the project root directory run the following command in a terminal to setup the build system.
cmake -S . -B build
Then run the following commands to build the executable and run tests.
cmake --build build
ctest --test-dir build
Run the math executable on a terminal as follows:
./math <number> '<operator>' <number>
Operator | Description |
---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
^ |
Exponentiation |
// |
Division |
% |
Modulus |
Metacharacters such as *
should be quoted to avoid accidental interpretation by the shell.
- Support for Floating Point numbers.
- Support for longer expressions.
- Parenthesis.
- Improve speed and memory usage.