public float Calc(Func <string, List <float>, float> func) { switch (op) { case Operator.Plus: return(term1.Calc(func) + term2.Calc(func)); case Operator.Minus: return(term1.Calc(func) - term2.Calc(func)); case Operator.Multi: return(term1.Calc(func) * term2.Calc(func)); case Operator.Divide: return(term1.Calc(func) / term2.Calc(func)); case Operator.Mod: return(term1.Calc(func) % term2.Calc(func)); } return(0); }
public float Calc(Func <string, List <float>, float> func) { return(-node.Calc(func)); }