How to get the ceiling of N (the smallest integer not less than N) in Python

1 Answer

0 votes
import math

print(math.ceil(21.18))
print(math.ceil(-21.18))
print(math.ceil(10.13))
print(math.ceil(10.79))
print(math.ceil(math.pi))
print(math.ceil(120))
print(math.ceil(0.1))
print(math.ceil(0.3))
print(math.ceil(0.7))
print(math.ceil(0.08))


'''
run:

22
-21
11
11
4
120
1
1
1
1

'''

 



answered Oct 11, 2017 by avibootz
...