Message11982

Author jamesmudd
Recipients jamesmudd, jeff.allen
Date 2018-05-15.22:23:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526422984.34.0.682650639539.issue2672@psf.upfronthosting.co.za>
In-reply-to
Content
I have had a quick look at this and it's kind of an edge case were i'm not sure if we should fix it.

The issue occurs in: org.python.core.stringlib.IntegerFormatter.format_d(int)

Where the minus sign is handled separate to the value itself. The value is then negated and passed to Java Integer.toString(-value). This is suposed to result in a positive sting representation. However in the edge case of passing in Integer.MIN_VALUE it results in "-2147483648". This can be demonstrated just in java see attached example.

The core of the problem is Integer.MIN_VALUE=-2^31 whereas Integer.MAX_VALUE=2^31-1 (https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html) so -Integer.MIN_VALUE doesn't fit in an int.
History
Date User Action Args
2018-05-15 22:23:04jamesmuddsetmessageid: <1526422984.34.0.682650639539.issue2672@psf.upfronthosting.co.za>
2018-05-15 22:23:04jamesmuddsetrecipients: + jamesmudd, jeff.allen
2018-05-15 22:23:04jamesmuddlinkissue2672 messages
2018-05-15 22:23:03jamesmuddcreate