Why do Python’s math.ceil() and math.floor() operations return floats instead of integers?
As pointed out by other answers, in python they return floats probably because of historical reasons to prevent overflow problems. However, they return integers in python 3. >>> import math >>> type(math.floor(3.1)) <class ‘int’> >>> type(math.ceil(3.1)) <class ‘int’> You can find more information in PEP 3141.