These are to be fixed in the next version. Currently they are indeed painfully slow, due to the way they're defined in the include file. To see what's happening run ucExpand("Max(1,2,3,4,5,6,7,8,9,10)") and you'll see that it expands to many nested expressions. Until the next version is released here is a speedy implementation that will work in version 2.96:
// IMPORTANT: Remember to use _stdcall for your uCalc callbacks
void _stdcall MyMaximum(DWORD Expr)
{
long x;
double Value, MaxValue;
MaxValue = ucParam(Expr, 1);
for(x = 2; x <= ucParamCount(Expr); x++)
{
Value = ucParam(Expr, x);
if (Value > MaxValue) MaxValue = Value;
}
ucReturn(Expr, MaxValue);
}
// IMPORTANT: Remember to use _stdcall for your uCalc callbacks
void _stdcall MyMinimum(DWORD Expr)
{
long x;
double Value, MinValue;
MinValue = ucParam(Expr, 1);
for(x = 2; x <= ucParamCount(Expr); x++)
{
Value = ucParam(Expr, x);
if (Value < MinValue) MinValue = Value;
}
ucReturn(Expr, MinValue);
}
ucDefineFunction("Native: Max(x ...)", MyMaximum);
ucDefineFunction("Native: Min(x ...)", MyMinimum);