Python Mathematical Function
Functions can do anything, but their primary use pattern is taking parameters and returning values . The math module provides some basic mathematical functions for working with floating-point numbers. Using Math module in python, we can access to different mathematical functions already defined by the C standard. These functions perform various arithmetic operations like calculating the floor, ceiling, or absolute value of a number using the floor(x), ceil(x), and fabs(x) functions respectively. Here is the list of all the functions and attributes defined in math module with a brief explanation of what they do.ceil(x)
Return the ceiling of x as a float, the smallest integer value greater than or equal to x.
Return x with the sign of y. On a platform that supports signed zeros, copysign(1.0, -0.0) returns -1.0. (New in version 2.6.)
This function will return an absolute or positive value.
Returns the factorial of x
The method floor() returns floor of x - the largest integer not greater than x.
This function returns x % y.
Returns the mantissa and exponent of x as the pair (m, e)
This function adds the items of an iterable and returns the sum.
This function is either True or False.
This function Returns True if x is a positive or negative infinity
Returns True if x is a NaN
This function returns the result of x * (2**i) which is an inverse of the frexp() function.
This function returns the fractional and integer parts of x in a two-item tuple. Both parts have the same sign as x. The integer part is returned as a float.
This function returns the truncated integer of x.
This function returns exponential of x: ex.
This function returns x raised to the power y
Returns the square root of x
Mathematical constant, the ratio of circumference of a circle to it's diameter (3.14159...)
mathematical constant e (2.71828...)