Re: ArithmeticException from unchecked-add

2014-05-20 Thread Greg D
Thanks. I've got to pay more attention to the distinction between long and Long in the documentation. The docs for unchecked-add ( > http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/unchecked-add > ) > only cover the case of both arguments being primitive longs. > -- You r

Re: ArithmeticException from unchecked-add

2014-05-19 Thread Stephen Gilardi
On May 19, 2014, at 2:17 PM, Greg D wrote: > user> (unchecked-add ^Long(Long/MAX_VALUE) ^Long(Long/MAX_VALUE) ) > ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow > (Numbers.java:1424) The docs for unchecked-add (http://clojure.github.io/clojure/clojure.core-api.htm

ArithmeticException from unchecked-add

2014-05-19 Thread Greg D
I didn't expect this one. See the illustrative sequence below. Should I be reporting this as a bug, or re-read the docs? ; CIDER 0.5.0 (Clojure 1.6.0, nREPL 0.2.3) user> (require '[clojure.stacktrace :as st]) user> (unchecked-add (Long/MAX_VALUE) (Long/MAX_VALUE) ) -2 user> (unchecked-add ^lo