which was unaware of being used in the ECalc context. Just convert the arguments to floats or whatever C# type and go.
Now the arguments are of type Evaluant.Calculator.Expression and this no longer works. In my function I have to repeat the whole handling of Parameters etc again for each argument.

I have found the reason and the alternative. Actually I made this change as the if() function didn't work. Let me explain:

The mistake was that the if(a, b, c) function should return "b" if "a" is true, and "c" otherwise. This function is often used when testing divisions by zeeo. For instance, if([x] != 0, 16/[x], 0).
Now imagine [x] is 0. If NCalc was evaluating all parameters, we would always have the exception, before the real if() behaviour is called. Thus this is to the if() function to define when each parameters as to be called, and that's why external functions get
Expression instances. Because this could be also you case.

Though, in your case you prefer to have the pre-evaluated values. I've just implemented a solution for this case. I'll create a release later, but you can already use this technique inside you delegate:

publicobject[] EvaluateParameters()

{

object[] values = newobject[parameters.Length];

for (int i = 0; i < values.Length; i++)

{

values[i] = parameters[i].Evaluate();

}

return values;

}

This method is now added to FunctionArgs. In the meantime you can add it as a static one inside your code and to take your example have this: