Floor Function - Python Math Module

Method Name: 


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.


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))


Floor of Golden Ratio : 1

Floor for Euler Number : 2

Copyright 2023 © pythontic.com