Created http://dev.clojure.org/jira/browse/CLJ-690 for this. Thanks!
Stu > Ah, I'm embarassed for not trying it on the developer version earlier > -- I'm running 1.2. Since Clojure 1.3 changes the semantics of - > w.r.t. overflow, it succesffully catches this. > > However, -' still has this bug as of Clojure 1.3 Alpha 4: > > Clojure 1.3.0-alpha4 > user=> (-' 0 -9223372036854775808) > -9223372036854775808 > > > On Dec 12, 9:17 pm, Stuart Halloway <[email protected]> wrote: >> Hi James, >> >> I am not seeing this behavior on master. If you are, would love to know >> additional context. >> >> Stu >> >>> 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 [email protected] >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
