Python's math module contains handy functions like floor & ceil. These functions take a number and return the nearest integer below or above it. However, these functions return the answer as a floating-point number. For example:
import math
f=math.floor(2.3)
Now f returns:
2.0
What is the safest way to get an integer out of this float, without running the risk of rounding errors (for example if the float is the equivalent of 1.99999) or perhaps I should use another function altogether?