You can just do upside-down floor division:
def ceildiv(a, b):
return -(-a // b)
This works because Python's division operator does floor division (unlike in C, where integer division truncates the fractional part).
This also works with Python's big integers, because there's no (lossy) floating-point conversion.
Here's a demonstration:
>>> from __future__ import division # a/b is float division
>>> from math import ceil
>>> b = 3
>>> for a in range(-7, 8):
... print(["%d/%d" % (a, b), int(ceil(a / b)), -(-a // b)])
...
['-7/3', -2, -2]
['-6/3', -2, -2]
['-5/3', -1, -1]
['-4/3', -1, -1]
['-3/3', -1, -1]
['-2/3', 0, 0]
['-1/3', 0, 0]
['0/3', 0, 0]
['1/3', 1, 1]
['2/3', 1, 1]
['3/3', 1, 1]
['4/3', 2, 2]
['5/3', 2, 2]
['6/3', 2, 2]
['7/3', 3, 3]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…