Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/syedhassaanahmed/mathexpressionapi

Math Expression Parser
https://github.com/syedhassaanahmed/mathexpressionapi

csharp-code dotnet-framework mathematics postfix

Last synced: 6 days ago
JSON representation

Math Expression Parser

Awesome Lists containing this project

README

        

MathExpressionAPI
=================

Mathematical expression parser

* Takes string input, parses and identifies Variables, Constants and Operators.
* Converts expression to Postfix.
* Evaluates the expression based on provided values (Default Variable value is Zero if not provided).
* New operators can be added to OperatorLibrary collection.
* Variable values are read from Properties of Anonymous Objects.
* Unit Tests for Postfix conversion are available.

Example

var e = new Expression("(A+B)/C");

double result = e.Evaluate(new { A = 4, B = 8, C = 3 });

Answer: 4