math.floor()
Anonymous contributor
Anonymous contributor1 total contribution
Anonymous contributor
Published Feb 29, 2024
Contribute to Docs
The math.floor()
function takes in a numeric data type and rounds the value down to the nearest integer.
Syntax
math.floor(n)
The math.floor()
function takes in a value and returns its floor, the smallest integer greater than or equal to that value.
Example
Here’s an example of math.floor()
to return the floor of 134.2
:
import mathprint(math.floor(134.2))
The above code give the following output:
134
Codebyte Example
The following example is runnable and uses the math.floor()
function to return the floor of a number:
All contributors
- Anonymous contributorAnonymous contributor1 total contribution
- Anonymous contributor
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.