In Clojure, all primitive integers are primitive long , and the documentation on the page with numbers refers to this. in 1.3 you just need large numbers to get an overflow.
user=> (+ Long/MAX_VALUE Long/MAX_VALUE) ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Numbers.java:1374)
This important part is that older versions of Clojure automatically moved to a large int, and it was decided that the cost was not worth the extremely rare cases when this is desired. if you really want to promote mathematical use +'
user=> (+' Long/MAX_VALUE Long/MAX_VALUE) 18446744073709551614N
Arthur ulfeldt
source share