Mathematical Expressions
Evaluate mathematical expressions directly from the command line. Write an expression and get its result.
Example
2 + 3 * (4 - 1)A lightweight command-line interpreter for evaluating mathematical expressions, storing variables, and executing built-in commands.
View RepositoryLanguage
CInterface
Command line
Core concept
Expression evaluation
The goal of this project is to build a mathematical interpreter from scratch in C. Instead of relying on an existing expression evaluator, the interpreter processes user input and evaluates mathematical expressions itself.
The interface is intentionally simple: enter a mathematical expression to evaluate it, assign an expression to a variable to store its value, or use a command to interact with the interpreter.
Capabilities
Evaluate mathematical expressions directly from the command line. Write an expression and get its result.
Example
2 + 3 * (4 - 1)Store expression results in named variables and reuse them in subsequent calculations.
Example
VARIABLE_NAME=2 + 3Discover the built-in functions available in the interpreter using a dedicated command.
Example
/btinUsage
The interpreter accepts mathematical expressions and provides dedicated commands for managing the session.
$2 + 3 * 4
14
$var={10 + 5}
15
$/vars
Stored variables
var = 15
$/btin
List available built-in functions
$/exit
Exit the interpreter
Illustrative session. The displayed output and variable formatting may differ from the actual implementation.
Reference
/exitExit the interpreter.
/varsDisplay the stored variables.
/btinList the available built-in functions.