Ejemplo n.º 1
0
        public static int Main()
        {
            Console.WriteLine("Both results should be 15");
            // This works
            byte dataByte = 0xF0;

            dataByte >>= 4; // becomes 0x0F
            Console.WriteLine(dataByte);

            // This gives wrong result
            ShiftTest shiftTest = new ShiftTest();

            shiftTest.data >>= 4; // becomes 0xFF
            Console.WriteLine(shiftTest.data);

            if (shiftTest.data != 0x0F)
            {
                Console.WriteLine("FAILED");
                return(1);
            }
            else
            {
                Console.WriteLine("PASSED");
                return(100);
            }
        }
Ejemplo n.º 2
0
        public static int Main()
        {
            Console.WriteLine("Both results should be 15");
            // This works
            byte dataByte = 0xF0;
            dataByte >>= 4; // becomes 0x0F
            Console.WriteLine(dataByte);

            // This gives wrong result
            ShiftTest shiftTest = new ShiftTest();
            shiftTest.data >>= 4; // becomes 0xFF
            Console.WriteLine(shiftTest.data);

            if (shiftTest.data != 0xF)
                return 1;
            else
                return 100;
        }