unchecked-negate negates one numeric value without checking for integer overflow. It belongs to Clojure’s unchecked-* operators and returns the corresponding numeric result. section 5.13
Its contract is narrow:
- Accepts exactly one numeric argument. section 5.13
- Returns the negated value, with the result type determined by numeric type contagion. section 5.13
- Omits integer-overflow checking, making unchecked arithmetic useful for operations such as hashing. section 5.13
Basic negation
(unchecked-negate 1) ;; -1
