Exemple #1
0
        public static Frac operator !(Frac a)
        {
            Frac res = new Frac(a.Denominator, a.Numerator);

            res.Fix();
            return(res);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Frac a = new Frac(1, 2);
            //Frac g = new Frac(1.7);
            Frac r = 1 + a + a + 2;

            Console.WriteLine(r);
        }
Exemple #3
0
        public static Frac operator /(Frac a, Frac b)
        {
            Frac res = a * !b;

            res.Simlify();
            res.Fix();
            return(res);
        }
Exemple #4
0
        public static Frac operator *(Frac a, Frac b)
        {
            Frac res = new Frac(a.Numerator * b.Numerator, b.Denominator * a.Denominator);

            res.Simlify();
            res.Fix();
            return(res);
        }