math.ceil()
Takes in a numeric data type and rounds the value up to the nearest integer.
Syntax
math.ceil(n)
The math.ceil()
function takes in a value and returns its ceiling, the smallest integer greater than or equal to that value.
Example
Use math.ceil()
to return the ceiling of 134.2
:
import mathprint(math.ceil(134.2))# Output: 135
Codebyte Example
The following example is runnable and uses the math.ceil()
function to return the ceiling of a number:
All contributors
- cslylla54 total contributions
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- Anonymous contributorAnonymous contributor194 total contributions
- karthikMurali16510165651 total contribution
- cslylla
- christian.dinh
- Anonymous contributor
- Anonymous contributor
- karthikMurali1651016565
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.