Beispiel #1
0
 private static void Uppgift4()
 {
     MyDoubleType mdt1 = new MyDoubleType(5);
     MyDoubleType mdt2 = mdt1 + 5;
     MyDoubleType mdt3 = mdt1 + mdt2;
     MyDoubleType mdt4 = new MyDoubleType(5);
     Console.WriteLine("{0}, {1}, {2}, {3}, {4}",
         mdt1, mdt2, mdt3, mdt1 > mdt2, mdt1 == mdt4);
 }
Beispiel #2
0
        private static void DoubleTrubbel()
        {
            MyDoubleType mdt1 = new MyDoubleType(5);
            Console.WriteLine("mdt1: " + mdt1);

            MyDoubleType mdt2 = mdt1 + 5;
            Console.WriteLine("mdt1 + 5: " + mdt2);

            MyDoubleType mdt3 = mdt1 + mdt2;
            Console.WriteLine("mdt1 + mdt2: " + mdt3);

            MyDoubleType mdt4 = new MyDoubleType(5);
            Console.WriteLine("new MyDoubleType(5): " + mdt4);
            bool b = mdt1 == mdt4;
            Console.WriteLine("mdt1: " + mdt1);
            Console.WriteLine("mdt2: " + mdt2);
            Console.WriteLine("mdt3: " + mdt3);
            Console.WriteLine("mdt4: " + mdt4);

            Console.WriteLine("mdt1: {0}, mdt2: {1}, mdt3: {2}, mdt1 > mdt2: {3}, mdt1 == mdt4: {4}",

                 mdt1, mdt2, mdt3, mdt1 > mdt2, mdt1 == mdt4);
        }