Home >>Python math Module >Python math.floor() Method

Python math.floor() Method

Python math.floor() Method

Python math.floor() method in python is used to returns the floor of given number value x downwards to the nearest integer, a number value that is not greater than x.

Syntax:
math.floor(x)

Parameter Values

Parameter Description
X It is required a number to return the floor of a number
Here is an example of Python math.floor() Method:

import math
print(math.floor(1.3))
print(math.floor(0.24))
print(math.floor(4.8))a
print(math.floor(-12.6))

Output:
1
0
4
-13
Example 2:

import math
print(math.floor(5))
print(math.floor(4))
print(math.floor(3))
print(math.floor(2))

Output:
5
4
3
2