gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
60 stars 38 forks source link

Overflow error in negating most negative int #59

Open leafstorm opened 10 years ago

leafstorm commented 10 years ago

From russell....@gordon.edu on September 08, 2012 14:55:17

min = int(-2147483648)
-min What is the expected output? What do you see instead? Should be 2147483648L; is -2147483648 (JES or the underlying Jython fails to deal with the overflow that results from negating the most negative int by converting result to long) What version of the product are you using? On what operating system? JES 4.3 on MacOS 10.6 Please provide any additional information below.

Original issue: http://code.google.com/p/mediacomp-jes/issues/detail?id=59

NicMcPhee commented 9 years ago

This appears to be a problem with Jython 2.2.1, which is what JES 4.3 used. It's still true in the latest release version of Jython (2.5.3), but is fixed in the current release candidate of 2.7 (2.7rc3). This suggests that the "simplest" thing is probably to wait the new version of Jython takes care of things.