Is there a built-in way to get max value on arithmetic overflow?
Here's what I need:
var val = byte.MaxValue + 1;
//should be rounded down to byte.MaxValue
MyByteProperty = val;
P.S. I know I can do that by wrapping it as a checked
expression as Alex answered, my question is if there's a built-in way in the language or BCL.