FLOATS TO INTSΒΆ

Floats are turned into integers by simply returning the integer component of the float. For example, \(1.9 = 1 + 0.9\), so int(1.9) = 1, but \(2.1 = 2 + 0.1\) so that int(2.1) = 2. Meanwhile \(-1.9 = -1 - 0.9\), so int(-1.9) = -1, but \(-2.1 = -2 - 0.1\) so that int(-2.1) = -2.

Warning

The int() function does NOT round to the nearest integer.