Exemple #1
0
        public Fraction FindMax()
        {
            Fraction max = a[0];

            for (int i = 1; i < length; i++)
            {
                //float x = max.numerator * a[i].denominator;
                //float y = a[i].numerator * max.denominator;
                //if (x < y)
                //	max = a[i];

                //if (CompareTwoFractions(max, a[i]) < 0)
                if (max.CompareTwoFractions(a[i]) < 0)
                {
                    max = a[i];
                }
            }
            max.RutGon();
            return(max);
        }
Exemple #2
0
        public Fraction FindMin()
        {
            //int x, y;
            Fraction min = a[0];

            for (int i = 1; i < length; i++)
            {
                //x = min.numerator * a[i].denominator;
                //y = a[i].numerator * min.denominator;
                //if (x > y)
                //	min = a[i];

                //if (CompareTwoFractions(max, a[i]) > 0)
                if (min.CompareTwoFractions(a[i]) > 0)
                {
                    min = a[i];
                }
            }
            min.RutGon();
            return(min);
        }