Namespace: StringMath
Assembly: StringMath
Inheritance: Object → MathExprExtensions
References: MathExpr, IMathContext
Extensions for MathExpr.
public static class MathExprExtensions
Evaluates a math expression from a string in a given context.
public static double Eval(string value);
Parameters
value String: The math expression.
value
Returns
Double: The result as a double.
public static double Eval(string value, IMathContext context);
value String
context IMathContext
context
Double
Converts a string to a MathExpr and substitutes the given variable.
public static MathExpr Substitute(string expr, string var, double val);
expr String: The math expression.
expr
var String: The variable's name.
var
val Double: The variable's value.
val
MathExpr: A MathExpr.
Converts a string expression to a MathExpr.
public static MathExpr ToMathExpr(string expr);
expr String: The string to convert.
public static MathExpr ToMathExpr(string expr, IMathContext context);
expr String
MathExpr
There was an error while loading. Please reload this page.