Compare() 개인적인 정적인 메소드

private static Compare ( double x, double y ) : double
x double
y double
리턴 double
예제 #1
0
파일: mathobject.cs 프로젝트: ydunk/masters
        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));
        }
예제 #2
0
파일: mathobject.cs 프로젝트: ydunk/masters
        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));
        }