gender ()
The floor () method in Python returns floor of x, that is, the largest integer not greater than x.
Syntax: import math math.floor (x) Parameter: x-numeric expression. Returns: largest integer not greater than x.
Below is the Python implementation of the floor () method:
|
Output:
math.floor (-23.11): -24.0 math.floor (300.16): 300.0 math.floor (300.72): 300.0
CEIL ()
The ceil () method in Python returns the ceiling x, which is the smallest integer not less than x.
Syntax: import math math.ceil (x) Parameter: x: This is a numeric expression. Returns: Smallest integer not less than x.
Below is the implementation of the ceil () method in Python:
|
Output:
math.ceil (-23.11): -23.0 math.ceil (300.16): 301.0 math.ceil (300.72): 301.0
Latest questions