text: public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0,ValueEval arg1) {double dn;try {ValueEval ve1 = OperandResolver.getSingleValue(arg1, srcRowIndex, srcColumnIndex);dn = OperandResolver.coerceValueToDouble(ve1);} catch (EvaluationException e1) {return ErrorEval.VALUE_INVALID;}if (dn < 1.0) {return ErrorEval.NUM_ERROR;}int k = (int) Math.ceil(dn);double result;try {double[] ds = ValueCollector.collectValues(arg0);if (k > ds.length) {return ErrorEval.NUM_ERROR;}result = _isLarge ? StatsLib.kthLargest(ds, k) : StatsLib.kthSmallest(ds, k);NumericFunction.checkValue(result);} catch (EvaluationException e) {return e.getErrorEval();}return new NumberEval(result);}