Issue 28 created with patch attached: http://code.google.com/p/clojure/issues/detail?id=28
On Dec 14 2008, 12:42 am, Olov Lassus <olov.las...@gmail.com> wrote: > Hi, > thanks for Clojure! Here's my first contribution (CA filled out and > will arrive next week): > > Negating Integer.MIN_VALUE overflows but should return a BigInteger. > It also affects binary subtraction since Clojure implements it using > negation and addition. The overflow occurs silently without throwing > an exception. > > These examples trigger the flaw: > > user=> (- -2147483648) > -2147483648 > > user=> (- -1 -2147483648) > -2147483649 > > The attached patch is created against trunk r1159. Same examples after > applying it: > > user=> (- -2147483648) > 2147483648 > > user=> (- -1 -2147483648) > 2147483647 > > /Olov Lassus > > detect_negate_overflow.patch > < 1KViewDownload > > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---