I have the following piece of example code:
UInt16 a = 0x3A;
UInt16 b = 0xFFDF;
UInt16 result = Convert.ToUInt16(a - b);
line 3 errors with an Overflow exception. However i want to achieve the same result like i would subtract 2 unsigned shorts in C and they over/underflow.
What is the most proper way to achieve this?