-
-
Notifications
You must be signed in to change notification settings - Fork 5
MathContext
Namespace: StringMath
Assembly: StringMath
Inheritance: Object → MathContext
Implements: IMathContext
References: IMathContext, Precedence
public sealed class MathContext : IMathContextCreates a new instance of a MathContext.
public MathContext(IMathContext parent);Parameters
parent IMathContext: The parent context to inherit operators from.
Creates a new instance of a MathContext.
public MathContext();The global instance used by StringMath.MathExpr.AddOperator(System.String,System.Func{System.Double,System.Double}) methods.
public static IMathContext Default;Field Value
The parent context to inherit from.
public virtual IMathContext Parent { get; set; }Property Value
public virtual double EvaluateBinary(string op, double a, double b);Parameters
op String
a Double
b Double
Returns
public virtual double EvaluateUnary(string op, double a);Parameters
op String
a Double
Returns
public virtual Precedence GetBinaryPrecedence(string operatorName);Parameters
operatorName String
Returns
public virtual bool IsBinary(string operatorName);Parameters
operatorName String
Returns
public virtual bool IsUnary(string operatorName);Parameters
operatorName String
Returns
public virtual void RegisterBinary(string operatorName, Func<Double, Double, Double> operation, Precedence? precedence = null);Parameters
operatorName String
operation Func<Double, Double, Double>
precedence Precedence?
public virtual void RegisterUnary(string operatorName, Func<Double, Double> operation);Parameters
operatorName String
operation Func<Double, Double>