eval method

  1. @override
Decimal eval(
  1. List<Decimal?> parameters
)
override

Implementation for this function.

parameters - Parameters will be passed by the expression evaluator as a {@link List} of {@link BigDecimal} values. Returns the function must return a new {@link BigDecimal} value as a computing result.

Implementation

@override
Decimal eval(List<Decimal?> parameters) {
  List<Decimal> params = [];

  for (int i = 0; i < parameters.length; i++) {
    if (parameters[i] == null) {
      throw new AssertionError("Operand #${i + 1} may not be null.");
    }

    params.add(parameters[i]!);
  }

  return fEval(params);
}