Простые типы / Числа / Integer

;; + checks the range and throws instead of wrapping silently
(println
  (try (+ Long/MAX_VALUE 1)
       (catch ArithmeticException e (str "error: " (.getMessage e)))))

;; +' (and *', -', inc') promotes to BigInt instead of throwing
(def promoted (+' Long/MAX_VALUE 1))
;; promoted is 9223372036854775808N
(println "promoted is" promoted (type promoted))

;; unchecked-add wraps around, the way C does
(println "wrapped is" (unchecked-add Long/MAX_VALUE 1))