As the title suggests, I want to take a floating point number and round it down to the nearest integer. However, if it\'s not a whole, I ALWAYS want to round down the variab
a lot of people say to use int(x)
, and this works ok for most cases, but there is a little problem. If OP's result is:
x = 1.9999999999999999
it will round to
x = 2
after the 16th 9 it will round. This is not a big deal if you are sure you will never come across such thing. But it's something to keep in mind.