예제 #1
0
        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);
        }
예제 #2
0
        //[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);
        }
예제 #3
0
        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);
        }