Skip to content

A simple implementation of an expression evaluator that can handle basic arithmetic operations.

License

Notifications You must be signed in to change notification settings

sharunashwanth/expression-evaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Expression Evaluator

This is a simple implementation of an expression evaluator that can handle basic arithmetic operations. It can convert infix expressions to postfix notation and then evaluate the postfix expression to obtain the result. The implementation also includes a check for balanced parentheses in the input expression. It utilizes a stack data structure to achieve this.

Functionalities

  • Balanced Parentheses Check: Verifies if the input expression has balanced parentheses.
  • Infix to Postfix Conversion: Converts mathematical expressions from infix notation to postfix notation.
  • Postfix Expression Evaluation: Evaluates postfix expressions containing basic arithmetic operations (+, -, *, /).

Usage

# Example Usage

result = myeval('9+8-3*(12-3)')
print("Result:", result) # Result: -10.0

Contact

If you have any questions, suggestions, or would like to connect, please feel free to reach out.


About

A simple implementation of an expression evaluator that can handle basic arithmetic operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published