{"id":24070,"date":"2021-10-14T09:12:54","date_gmt":"2021-10-14T03:42:54","guid":{"rendered":"https:\/\/python-programs.com\/?p=24070"},"modified":"2021-11-05T20:53:17","modified_gmt":"2021-11-05T15:23:17","slug":"python-program-for-floor-function","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-floor-function\/","title":{"rendered":"Python Program for floor() Function"},"content":{"rendered":"

In the previous article, we have discussed Python Program for fabs() Function<\/a>
\nfloor() Function in Python:<\/strong><\/p>\n

If necessary, the math.floor() method rounds a number DOWN<\/strong> to the nearest integer and returns the result.<\/p>\n

The python math. floor() function returns the nearest integer value that is less than or equal to the specified expression or Value.<\/p>\n

Syntax:<\/strong><\/p>\n

math.floor(number)<\/pre>\n

Parameter Values:<\/strong><\/p>\n

number: This is required. It Sets the number to round down.<\/p>\n

Return Value: <\/strong>The return value is an int value that represents the rounded number.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given tuple = (1.3, 10.04, -4.4, 7.7, 9.45)\r\nGiven List = [2.8, 3.4, -1.7, -6.82, 12.2]<\/pre>\n

Output:<\/strong><\/p>\n

Given positive number 9.2 floor value = 9.00\r\nGiven negative number -8.6 floor value = -9.00\r\nGiven Tuple element(gvn_tupl[3]) floor value = 7.00\r\nGiven Tuple element(gvn_lst[2]) floor value = -2.00\r\nThe floor of pi is:  3\r\nGiven multiple number(35+40-10.3) floor value  = 64.00<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given tuple = (2.4, 85.67, 37.8, -25.5)\r\nGiven List =  [45.9, 11.32, -25, 6, 12.8, -10]<\/pre>\n

Output:<\/strong><\/p>\n

Given positive number 30.1 floor value = 30.00\r\nGiven negative number -20.4 floor value = -21.00\r\nGiven Tuple element(gvn_tupl[0]) floor value = 2.00\r\nGiven Tuple element(gvn_lst[3]) floor value = 6.00\r\nThe floor of pi is:  3\r\nGiven multiple number(23-10+5) floor value  = 18.00<\/pre>\n

Program for floor() Function in Python<\/h2>\n