[issue36228] Support coercion of complex to float/int
Марат Нагаев
report at bugs.python.org
Fri Mar 8 11:18:35 EST 2019
Марат Нагаев <sidorovmarat1995 at gmail.com> added the comment:
>For those rare cases where this is needed, it isn't that hard to spell out `complex(floor(z.real)
But in Python we have math.tau. However it's just 2*pi.
>`math.floor` of a `float` object returns an `int`
Maybe the best solution is to add functions floor and ceil to cmath module and edit floor and ceil function (in case passing complex argument these function could raise TypeError)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36228>
_______________________________________
More information about the Python-bugs-list
mailing list