Hey guys i've been scavenging google for a couple days now trying to find an answer to my question, but to no avail. So i'm gonna ask you guys here on the codecall forums.
my question is, is it possible to round a floating point number up to the nearest whole number? and if so how to go about doing it.
thanks
-Anix
Yes it is possible. And amazingly easy!
The function ceil() rounds up towards positive infinity. See this.Code:
from math import ceil
print(ceil(7.6))
print(ceil(-1.4))
print(ceil(-1.5))
print(ceil(2.4))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks