Mark Dickinson <dicki...@gmail.com> added the comment:

> So I suggest:
> 1. Methods __floor__ and __ceil__ for complex object.

What's the use-case for these? It's not a particularly natural operation, and 
I've never had a need for a complex "floor" operation, either as a 
mathematician or as a developer. Do you have an example of real-world code that 
would benefit?

For those rare cases where this is needed, it isn't that hard to spell out 
`complex(floor(z.real), floor(z.imag))`, or to write a custom `complex_floor` 
function.

Also, what type should `math.floor` return when applied to a complex number? 
`math.floor` of a `float` object returns an `int`, so the analogous operation 
on a complex number should return a Gaussian integer. But we don't have a 
Gaussian integer type in standard Python, and it wouldn't be appropriate to add 
one.

----------

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

Reply via email to