This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients josh.r, lemburg, mark.dickinson, nagayev, rhettinger, stutzbach, zach.ware
Date 2019-03-08.10:59:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1552042791.89.0.903484942132.issue36228@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2019-03-08 10:59:51mark.dickinsonsetrecipients: + mark.dickinson, lemburg, rhettinger, stutzbach, zach.ware, josh.r, nagayev
2019-03-08 10:59:51mark.dickinsonsetmessageid: <1552042791.89.0.903484942132.issue36228@roundup.psfhosted.org>
2019-03-08 10:59:51mark.dickinsonlinkissue36228 messages
2019-03-08 10:59:51mark.dickinsoncreate