unchecked-inc-int increments a numeric value using Java's primitive int arithmetic. Unlike ordinary incrementing, it does not implicitly promote the value to Long or check for overflow, and it returns an int. section 5.14 section 5.6
Use it when integer-width behavior matters:
- Pass one numeric argument within the Integer range. section 5.14
- Receive a java.lang.Integer-compatible primitive int result. section 5.14
- Expect signed 32-bit wraparound at Integer/MAX_VALUE rather than promotion or an overflow exception. section 5.14 section 5.6
Incrementing inside integer arithmetic
A line-drawing loop uses (unchecked-inc-int x) and (unchecked-inc-int y) while processing coordinates in an integer-based Java array. The same implementation combines it with unchecked subtraction, division, and addition to keep the arithmetic in the int domain.
