You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight C# math expression evaluator with lazy parsing and solving during runtime, designed to be simple and easy to use, with support for standard order of operations and commonly used functions such as logarithms, trigonometry and factorials.
Examples
// Area of a circlevarexpression=newMathExpression("pi * 2^2");varevaluation=expression.Evaluate();
// Change of basevarexpression=newMathExpression("log(4) / log($e)");varevaluation=expression.Evaluate();
Supported Constants
Name
Symbol
Pi
pi
Euler's number
$e
Supported Functions
Unary Functions
Name
Symbol
Log2
lg
Log10
log
Natural Log
ln
Factorial
!
Sine
sin
Cosine
cos
Tangent
tan
Inverse Sine
arcsin
Inverse Cosine
arccos
Inverse Tangent
arctan
Hyperbolic Sine
sinh
Hyperbolic Cosine
cosh
Hyperbolic Tangent
tanh
Square Root
sqrt
Binary functions
Name
Symbol
Addition
+
Subtraction
-
Multiplication
*
Division
/
Exponentiation
^
Modulo
%
Supported Order of Operations
Name
Symbol
Open Parentheses
(
Close Parentheses
)
About
A lightweight C# math expression evaluator with lazy parsing and solving during runtime, designed to be simple and easy to use, with support for standard order of operations and commonly used functions such as logarithms, trigonometry and factorials.