[issue36228] Support coercion of complex to float/int

Марат Нагаев report at bugs.python.org
Fri Mar 8 00:11:55 EST 2019


Марат Нагаев <sidorovmarat1995 at gmail.com> added the comment:

I think math.floor should raise TypeError if complex argument passed,
but we need cmath.floor(and ceil).
As I know floor complex number is just floor real part and floor imag.
Example:
z=1.1+2.5j
floor(z) #2+3j
I think it's correct.
But I don't know about complex to float and to int.
Maybe you are right

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36228>
_______________________________________


More information about the Python-bugs-list mailing list