public override double GetValue(Dictionary <char, double> v) { switch (_opp) { case Opperator.Negative: return(-_t.GetValue(v)); default: throw new ArgumentOutOfRangeException(); } }
public override double GetValue(Dictionary <char, double> v) { switch (_opp) { case Opperator.Add: return(_l.GetValue(v) + _r.GetValue(v)); case Opperator.Subtact: return(_l.GetValue(v) - _r.GetValue(v)); case Opperator.Multiply: return(_l.GetValue(v) * _r.GetValue(v)); case Opperator.Divide: return(_l.GetValue(v) / _r.GetValue(v)); case Opperator.Raise: return(Math.Pow(_l.GetValue(v), _r.GetValue(v))); case Opperator.Modular: return(_l.GetValue(v) % _r.GetValue(v)); default: throw new ArgumentOutOfRangeException(); } }