Message387237
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 ;-) |
|
Date |
User |
Action |
Args |
2021-02-18 15:00:41 | vstinner | set | recipients:
+ vstinner, gvanrossum, rhettinger, serhiy.storchaka, PedanticHacker |
2021-02-18 15:00:41 | vstinner | set | messageid: <1613660441.7.0.4190875051.issue43255@roundup.psfhosted.org> |
2021-02-18 15:00:41 | vstinner | link | issue43255 messages |
2021-02-18 15:00:41 | vstinner | create | |
|