int/long anomaly in jython 2.7.0
"Niemann, Hartmut" <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <1AE3002F400CE4498072DFDF74A843CC20F46E51@DEFTHW99EH3MSX.ww902.siemens.net> |
Hello!
Is this a known bug in Jython 2.7.0?
x = int(-(1<<31))
print ('%d' % x)
results in
--2147483648
With two '-' signs.
For -(1<<31)+1 everything is fine,
for -(1<<31)-1 the resulting x has type long and everything is fine as well.
convert x to long and the result is correct as well.
Mit freundlichen Grüßen
Dr. Hartmut Niemann
Siemens AG
Mobility Division
Rolling Stock
Standardization, Remote Control, Display
MO RS LM EN CCI SRD
Werner-von-Siemens-Str. 67
91052 Erlangen, Deutschland
Mobil: +49 173 5342327
mailto:[email protected]
www.siemens.com/ingenuityforlife<https://siemens.com/ingenuityforlife>
[www.siemens.com/ingenuityforlife]
Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann Snabe; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Cedrik Neike, Michael Sen, Ralf P. Thomas; Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jython-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-dev
image001.gif
(image/gif, 3.5 KB) - not displayed