public static object MAX(IList args) { double max = double.MinValue; foreach (object v in OPs.Flatten(args)) { double?tmp = OPs.xl2dbl2(v); if (tmp.HasValue && tmp > max) { max = tmp.Value; } } return(max); }
//[Arity(2, 3)] //public static object IF(CallExpr ce, Generator.Ctx ctx) //{ return FuncDefs_Core.IF(ce, ctx); } public static object SUM(IList args) { double sum = 0; foreach (object v in OPs.Flatten(args)) { double?tmp = OPs.xl2dbl2(v); if (tmp.HasValue) { sum += tmp.Value; } } return(sum); }
public static object MIN(IList args) { double min = double.MaxValue; foreach (object v in OPs.Flatten(args)) { double?tmp = OPs.xl2dbl2(v); if (tmp.HasValue && tmp < min) { min = tmp.Value; } } return(min); }