minv() private static méthode

private static minv ( double lhMin, Object args, int start ) : double
lhMin double
args Object
start int
Résultat double
Exemple #1
0
        public static double min(Object x, Object y, params Object[] args)
        {
            if (x is Missing)
            {
                return(Double.PositiveInfinity);
            }
            double dx = Convert.ToNumber(x);

            if (y is Missing)
            {
                return(dx);
            }
            double dy     = Convert.ToNumber(y);
            double result = MathObject.Compare(dx, dy);

            if (result != result)
            {
                return(result);
            }
            double lhMin = dx;

            if (result > 0)
            {
                lhMin = dy;
            }
            if (args.Length == 0)
            {
                return(lhMin);
            }
            return(MathObject.minv(lhMin, args, 0));
        }
Exemple #2
0
        private static double minv(double lhMin, Object[] args, int start)
        {
            if (args.Length == start)
            {
                return(lhMin);
            }
            double head   = Convert.ToNumber(args[start]);
            double result = MathObject.Compare(lhMin, head);

            if (result != result)
            {
                return(result);
            }
            if (result < 0)
            {
                head = lhMin;
            }
            return(MathObject.minv(head, args, start + 1));
        }