Re: int/long anomaly in jython 2.7.0
David Charles <[email protected]>
| Newsgroups | gmane.comp.lang.jython.devel |
|---|---|
| Message-ID | <CAJHoYyLaUmOgK6XBpDHzYbNefkUPXXwD5cu2KcOMd_MR4-4Hgg@mail.gmail.com> |
I see it in jython2.7.1 as well. D On Wed, Apr 25, 2018 at 12:05 AM, Niemann, Hartmut < [email protected]> wrote: > 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] <[email protected]> > www.siemens.com/ingenuityforlife <https://siemens.com/ingenuityforlife> > [image: 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 > > ------------------------------------------------------------------------------ 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