unchecked-subtract-int subtracts its second numeric argument from its first after converting both to primitive 32-bit signed integers. It returns an int and deliberately allows overflow, making it useful when fixed-width integer arithmetic matters more than Clojure’s default long-based behavior. section 5.14 section 5.4
Use the function with these expectations:
- Pass two numeric arguments within the signed 32-bit integer range, from Integer/MIN_VALUE through Integer/MAX_VALUE. section 5.14
- Receive a primitive int result rather than a promoted long or higher-precision numeric value. section 5.14
- Expect rollover when subtraction reaches the limits of signed 32-bit precision; the operation performs no overflow checking. section 5.14
Integer arithmetic in line generation
A line-generation routine uses unchecked-subtract-int for coordinate differences: `(unchecked-subtract-int y1 y2)` compares vertical distance with horizontal distance, while `(unchecked-subtract-int x2 x1)` computes `dx`. The resulting integer values drive an iterative point-producing loop, which can then paint a line into a two-dimensional integer image array.
