Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

The docs for complex literals¹ could be improved to show that:

    -1j is interpreted as -complex(0.0, 1.0)
    giving a real component of -0.0
    and an imaginary component of -1.0

and that:

   0-1j  is interpreted as 0.0-complex(0.0, 1.0)
    giving a real component of 0.0
    and an imaginary component of -1.0

It is unfortunate the repr for complex numbers uses integers at all.  That 
hides what is going on.

¹ https://docs.python.org/3/reference/lexical_analysis.html#imaginary-literals

----------
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to