xxxxxxxxxx
# no import needed
# take advantage of floor division by negating a and flooring it
# then negate result to get a positive / negative (depending on input a)
def round_up(a, b = 1):
return -(-a // b) # wrap in int() if only want integers
>>> round_up(3.2) # works on single digits
4.0
>>> round_up(5, 2)
3
>>> round_up(-10, 4) # works on negative numbers
-2
xxxxxxxxxx
>>> import math
>>> math.ceil(5.2)
6
>>> math.ceil(5)
5
>>> math.ceil(-0.5)
0