user> (- 0 -9223372036854775808)
-9223372036854775808

It's worth noting that -9223372036854775808 is Long/MIN_VALUE, and
that this is the expected result with native 64-bit longs, though not
in a language with automatic long-to-BigInteger conversion. It appears
that a few related bugs (e.g.: http://dev.clojure.org/jira/browse/CLJ-32)
have been caught and fixed, but this one still lives.

(I now appreciate why "How do you detect integer overflows?" is one of
the favorite interview questions of the Software Engineering
Institute.)

Sincerely,
James Koppel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to