-
-
Notifications
You must be signed in to change notification settings - Fork 5
MathExpr
Miroiu Emanuel edited this page Oct 12, 2022
·
2 revisions
Namespace: StringMath
Assembly: StringMath
Inheritance: Object → MathExprExtensions
References: MathExpr, IMathContext
Extensions for MathExpr.
public static class MathExprExtensionsEvaluates a math expression from a string in a given context.
public static double Eval(string value);Parameters
value String: The math expression.
Returns
Double: The result as a double.
public static double Eval(string value, IMathContext context);Parameters
value String
context IMathContext
Returns
Converts a string to a MathExpr and substitutes the given variable.
public static MathExpr Substitute(string expr, string var, double val);Parameters
expr String: The math expression.
var String: The variable's name.
val Double: The variable's value.
Returns
Converts a string expression to a MathExpr.
public static MathExpr ToMathExpr(string expr);Parameters
expr String: The string to convert.
Returns
public static MathExpr ToMathExpr(string expr, IMathContext context);Parameters
expr String
context IMathContext
Returns