public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double result; try { double d0 = NumericFunction.SingleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex); double d1 = NumericFunction.SingleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex); result = Evaluate(d0, d1); NumericFunction.CheckValue(result); } catch (EvaluationException e) { return(e.GetErrorEval()); } return(new NumberEval(result)); }
public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { double result; try { double d0 = NumericFunction.SingleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex); double d1 = NumericFunction.SingleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex); ValueEval ve = OperandResolver.GetSingleValue(arg2, srcRowIndex, srcColumnIndex); bool? method = OperandResolver.CoerceValueToBoolean(ve, false); result = Evaluate(d0, d1); } catch (EvaluationException e) { return(e.GetErrorEval()); } return(new NumberEval(result)); }
public ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2, ValueEval arg3) { double result; try { double rate = NumericFunction.SingleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex); double d1 = NumericFunction.SingleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex); double d2 = NumericFunction.SingleOperandEvaluate(arg2, srcRowIndex, srcColumnIndex); double d3 = NumericFunction.SingleOperandEvaluate(arg3, srcRowIndex, srcColumnIndex); result = Evaluate(rate, d1, d2, d3); NumericFunction.CheckValue(result); } catch (EvaluationException e) { return(e.GetErrorEval()); } return(new NumberEval(result)); }
public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) { double result; try { double d0 = NumericFunction.SingleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex); double d1 = NumericFunction.SingleOperandEvaluate(arg1, srcRowIndex, srcColumnIndex); double logE = Math.Log(d0); double base1 = d1; if (base1 == Math.E) { result = logE; } else { result = logE / Math.Log(base1); } NumericFunction.CheckValue(result); } catch (EvaluationException e) { return(e.GetErrorEval()); } return(new NumberEval(result)); }