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

            res.Fix();
            return(res);
        }
Beispiel #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);
        }
Beispiel #3
0
        public static Frac operator /(Frac a, Frac b)
        {
            Frac res = a * !b;

            res.Simlify();
            res.Fix();
            return(res);
        }
Beispiel #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);
        }