Floor Function - Python Math Module

Method Name: 

floor(aNumber_in)

Method Overview: 

Returns the next integer smaller than the given number.
In other words, the method floor returns the biggest integer smaller than the given number.

Example:

import math

 

# Find floor for Golden Ration

GoldenRatio = 1.61803398874

floor1      = math.floor(GoldenRatio)

print("Floor of Golden Ratio : {}".format(floor1))

 

# Find floor for Euler Number

EulerNumber =    2.71828

floor2      = math.floor(EulerNumber)

print("Floor of Euler Number : {}".format(floor2))

Output:

Floor of Golden Ratio : 1

Floor for Euler Number : 2


Copyright 2023 © pythontic.com