How to use floor to get the closest integer value which is less than or equal to specified value in Python

1 Answer

0 votes
import math


print(math.floor(3)); 

print(math.floor(3.14)); 

print(math.floor(3.4));

print(math.floor(3.5));

print(math.floor(3.6));

print(math.floor(3.99));


    
'''
run:

3
3
3
3
3
3

'''

 



answered May 7, 2019 by avibootz
...