Message337466
> 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. |
|
Date |
User |
Action |
Args |
2019-03-08 10:59:51 | mark.dickinson | set | recipients:
+ mark.dickinson, lemburg, rhettinger, stutzbach, zach.ware, josh.r, nagayev |
2019-03-08 10:59:51 | mark.dickinson | set | messageid: <1552042791.89.0.903484942132.issue36228@roundup.psfhosted.org> |
2019-03-08 10:59:51 | mark.dickinson | link | issue36228 messages |
2019-03-08 10:59:51 | mark.dickinson | create | |
|