I'm trying to replicate the Java int overflow / underflow logic in SQL (SQL Server 2016). What would the logic be for:
(a * b) + c
where a, b, and c can range from -2147483648 to 2147483648 (the range of an int in SQL)
For example, in java if you calculate (135 * 12) + 2147483647, the result is -2147482029. In SQL, for an int, it'll error with an overflow. I need to replicate the java overflow / underflow logic in SQL, so it'll work the same and produce an int.