public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) {try {ValueEval ve = OperandResolver.getSingleValue(arg0, srcRowIndex, srcColumnIndex);final double result = OperandResolver.coerceValueToDouble(ve);if (Double.isNaN(result) || Double.isInfinite(result)) {throw new EvaluationException(ErrorEval.NUM_ERROR);}ve = OperandResolver.getSingleValue(arg2, srcRowIndex, srcColumnIndex);int order_value = OperandResolver.coerceValueToInt(ve);final boolean order;if (order_value==0) {order = true;} else if(order_value==1) {order = false;} else {throw new EvaluationException(ErrorEval.NUM_ERROR);}if (arg1 instanceof RefListEval) {return eval(result, ((RefListEval)arg1), order);}final AreaEval aeRange = convertRangeArg(arg1);return eval(result, aeRange, order);} catch (EvaluationException e) {return e.getErrorEval();}}

public override ValueEval Evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2){AreaEval aeRange;double result;bool order = false;try{ValueEval ve = OperandResolver.GetSingleValue(arg0, srcRowIndex, srcColumnIndex);result = OperandResolver.CoerceValueToDouble(ve);if (Double.IsNaN(result) || Double.IsInfinity(result)){throw new EvaluationException(ErrorEval.NUM_ERROR);}aeRange = ConvertRangeArg(arg1);ve = OperandResolver.GetSingleValue(arg2, srcRowIndex, srcColumnIndex);int order_value = OperandResolver.CoerceValueToInt(ve);if (order_value == 0){order = true;}else if (order_value == 1){order = false;}else throw new EvaluationException(ErrorEval.NUM_ERROR);}catch (EvaluationException e){return e.GetErrorEval();}return eval(srcRowIndex, srcColumnIndex, result, aeRange, order);}
