Skip to content

Add expression evaluator to C programs#380

Open
williamalexakis wants to merge 1 commit intodiwas7777:mainfrom
williamalexakis:feature/add-expression-evaluator
Open

Add expression evaluator to C programs#380
williamalexakis wants to merge 1 commit intodiwas7777:mainfrom
williamalexakis:feature/add-expression-evaluator

Conversation

@williamalexakis
Copy link

@williamalexakis williamalexakis commented Dec 1, 2025

Adds a mathematical expression evaluator to the C folder.

The program uses a basic recursive-descent parser I wrote to calculate math expressions with <math.h>.
It supports:

  • + - * /
  • Unary + -
  • sin cos tan sqrt log exp
  • Variables

Example usage:

./expression_eval "(x + y) * 2^3" x=4 y=15
152

@williamalexakis
Copy link
Author

Hey, could this PR please be reviewed? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant