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 vstinner
Recipients PedanticHacker, gvanrossum, rhettinger, serhiy.storchaka, vstinner
Date 2021-02-18.15:00:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613660441.7.0.4190875051.issue43255@roundup.psfhosted.org>
In-reply-to
Content
I'm not convinced that this operation is so common that it deserves a new operator. As Serhiy wrote, it must be first on python-ideas first. I close the issue.

--

floor division is x//y

integer ceil division can be implemented with math.ceil(x/y) for small numbers.

For large integer numbers, I like to use something like:

def ceil_div(x, y):
    rem=x % y
    if rem:
        x += y - rem
    return x//y

I let you adjust it for negative numbers ;-)
History
Date User Action Args
2021-02-18 15:00:41vstinnersetrecipients: + vstinner, gvanrossum, rhettinger, serhiy.storchaka, PedanticHacker
2021-02-18 15:00:41vstinnersetmessageid: <1613660441.7.0.4190875051.issue43255@roundup.psfhosted.org>
2021-02-18 15:00:41vstinnerlinkissue43255 messages
2021-02-18 15:00:41vstinnercreate