From: Jeff A. <ja...@fa...> - 2018-04-29 15:15:05
|
Now http://bugs.jython.org/issue2672. Sorry your registration failed. (Spam filter somewhere in the chain? I'm afraid I've no way to investigate.) Best wishes, Jeff Allen On 26/04/2018 14:05, Niemann, Hartmut wrote: > > Hello Jeff, > > thank you for confirming this behaviour and suggesting a workaround. > Using long() works perfectly in my case. > > Unfortunately i can not register at bugs.jython.org at the moment. At > least it hasn’t sent me the confirmation e-mail yet. > > Mit freundlichen Grüßen > Dr. Hartmut Niemann > > > *Von:*Jeff Allen [mailto:ja...@fa...] > *Gesendet:* Donnerstag, 26. April 2018 08:58 > *An:* jyt...@li...; Niemann, Hartmut (MO RS LM EN > CCI SRD) > *Betreff:* Re: [Jython-dev] int/long anomaly in jython 2.7.0 > > Not AFAIK, thanks for finding it. It's still in the development tip: > > >>> x = int(-(1<<31)) > >>> y = x + 1 > >>> x, y > (-2147483648, -2147483647) > >>> x.__format__('d') # Oops > '--2147483648' > >>> y.__format__('d') > '-2147483647' > > Almost certainly there is some thinking error in int.__format__(), > which % relies on, handling the positive of -2^31, which has no > representation as an int. A work-around is to make it a long: > > >>> '%d' % long(x) > '-2147483648' > > The right place for this is http://bugs.jython.org/ > <http://bugs.jython.org/> . You could open an issue there (so you'll > get e-mail when we work on it), or I will do so eventually. > > Jeff Allen > |