[issue17336] Complex number representation round-trip doesn't work with signed zero values

2020-08-05 Thread Eric Wieser
Eric Wieser added the comment: > BTW I don't want repr() of a complex number to use the complex(..., ...) A compromise would be to only use this notation if signed zeros are involved. --- Another option would be to use slightly unusual reprs for these complex numbers, which at least

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2020-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: Also related: #40269 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2020-08-05 Thread Mark Dickinson
Mark Dickinson added the comment: The issue of changing the complex repr came up again in #41485, which has been closed as a duplicate of this issue. See also https://bugs.python.org/issue23229#msg233963, where Guido says: > BTW I don't want repr() of a complex number to use the

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Manuel Jacob
New submission from Manuel Jacob: When evaluating, signed zero complex numbers aren't recovered correctly. -0j (-0-0j) (-0-0j) 0j 0j 0j According to http://docs.python.org/dev/reference/datamodel.html#object.__repr__ the representation can be used to recreate an object with the same value.

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, mark.dickinson, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17336 ___

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17336 ___ ___ Python-bugs-list

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: This is not easy to avoid, I'm afraid, and it's a consequence of Python's usual rules for mixed-type arithmetic: (-0-0j) is interpreted as 0 - (0.0 + 0.0j) --- that is, the 0j is promoted to a complex instance (by giving it zero real part) before the

[issue17336] Complex number representation round-trip doesn't work with signed zero values

2013-03-02 Thread Mark Dickinson
Mark Dickinson added the comment: An aside: C99 gets around this problem by allowing an (optional) Imaginary type, separate from Complex. Very few compilers support it, though. -- ___ Python tracker rep...@bugs.python.org