Python | math.floor() function Last Updated : 16 Feb, 2023 Comments Improve Suggest changes Like Article Like Report In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.floor() function returns the largest integer not greater than x. If number is already integer, same number is returned. Syntax: math.floor(x) Parameter: x: This is a numeric expression. Returns: largest integer not greater than x. Time Complexity: O(1) Auxiliary Space: O(1) Code #1: Python3 # Python code to demonstrate the working of floor() # importing "math" for mathematical operations import math x = 33.7 # returning the floor of 33.7 print ("The floor of 33.7 is : ", end ="") print (math.floor(x)) Output:The floor of 33.7 is : 33 Code #2: Python3 # Python code to demonstrate the working of floor() # importing "math" for mathematical operations import math # prints the floor using floor() method print ("math.floor(-13.1) : ", math.floor(-13.1)) print ("math.floor(101.96) : ", math.floor(101.96)) Output:math.floor(-13.1) : -14 math.floor(101.96) : 101 Comment More infoAdvertise with us Next Article Python | math.floor() function S Shivam_k Follow Improve Article Tags : Python Python math-library-functions Practice Tags : python Similar Reads Python | math.gcd() function In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.gcd() function compute the greatest common divisor of 2 numbers mentioned in its arguments. Syntax: math.gcd(x, y) Parameter: x : Non-negative integer whose gcd has to be comp 2 min read Python | fmod() function fmod() function is one of the Standard math library function in Python, which is used to calculate the Module of the specified given arguments. Syntax: math.fmod( x, y ) Parameters: x any valid number (positive or negative). y any valid number(positive or negative). Returns: Return a floating point 2 min read Python - math.ulp(x) function ULP stands for âUnit in the Last Placeâ. math.ulp() is introduced in python 3.9.0 version, it returns the value of the least significant bit of the float x. In numerical analysis and computer science, unit of least precision (ULP) or unit in the last place is the spacing between floating-point numbe 2 min read Python int() Function The Python int() function converts a given object to an integer or converts a decimal (floating-point) number to its integer part by truncating the fractional part.Example:In this example, we passed a string as an argument to the int() function and printed it.Pythonage = "21" print("age =", int(age) 3 min read Python oct() Function Python oct() function takes an integer and returns the octal representation in a string format. In this article, we will see how we can convert an integer to an octal in Python. Python oct() Function SyntaxSyntax : oct(x) Parameters: x - Must be an integer number and can be in either binary, decimal 2 min read floor() and ceil() function Python Python provides a built-in math module that includes many useful mathematical functions and constants. It is commonly used for operations such as rounding numbers, working with trigonometric functions, performing logarithmic calculations, and more."Among these are two commonly used functions:floor() 4 min read modf() function - Python modf() function is an inbuilt function in Python that returns the fractional and integer parts of the number in a two-item tuple. Both parts have the same sign as the number. The integer part is returned as a float. Example:Pythonimport math # modf() function used with a positive number print("math. 3 min read numpy.floor() in Python The numpy.floor() function returns the largest integer less than or equal to each element in the input array. It effectively rounds numbers down to the nearest whole number. Let's understand with an example:Pythonimport numpy as np a = [0.5, 1.5, 2.5, 3, 4.5, 10.1] res = np.floor(a) print("Floored:" 1 min read Python | ldexp() function ldexp() function is one of the Standard math library function in Python, which returns x * (2**i). This is also called as inverse of Python frexp() function. Syntax: math.ldexp(x, i) Parameters: x : Any valid number (+ve or -ve) i : Any valid number (+ve or -ve) Returns : Returns the value of x * (2 2 min read round() function in Python Python round() function is a built-in function available with Python. It will return you a float number that will be rounded to the decimal places which are given as input. If the decimal places to be rounded are not specified, it is considered as 0, and it will round to the nearest integer. In this 6 min read Like