Message366280
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 |
|
Date |
User |
Action |
Args |
2020-04-13 01:46:55 | rhettinger | set | recipients:
+ rhettinger, mark.dickinson, josh.r, rushilu |
2020-04-13 01:46:55 | rhettinger | set | messageid: <1586742415.87.0.104476192401.issue40269@roundup.psfhosted.org> |
2020-04-13 01:46:55 | rhettinger | link | issue40269 messages |
2020-04-13 01:46:55 | rhettinger | create | |
|