Exemple #1
0
        internal static ushort MulOvf(ushort x, ushort y)
        {
            uint z = UInt32.MulOvf(x, y);

            if (z > ushort.MaxValue || z < ushort.MinValue)
            {
                throw new OverflowException();
            }
            return((ushort)z);
        }
Exemple #2
0
        internal static byte MulOvf(byte x, byte y)
        {
            uint z = UInt32.MulOvf(x, y);

            if (z > byte.MaxValue || z < byte.MinValue)
            {
                throw new OverflowException();
            }
            return((byte)z);
        }