Python math module
Python math module is defined as the most popular mathematical functions, which includes trigonometric functions, representation functions, logarithmic functions, etc. Furthermore, it also defines two mathematical constants, i.e., Pie and Euler number, etc.
Pie (n): It is a well-known mathematical constant and defined as the ratio of circumstance to the diameter of a circle. Its value is 3.141592653589793.
Euler's number(e): It is defined as the base of the natural logarithmic, and its value is 2.718281828459045.
There are different math modules which are given below:
This method returns the natural logarithm of a given number. It is calculated to the base e.
log(fabs(x), base) is : -6.698970004336019
This method returns base 10 logarithm of the given number and called the standard logarithm.
log10(x) is : 1.1139433523068367
This method returns a floating-point number after raising e to the given number.
The given number (x) is : 0.05 e^x (using exp() function) is : 0.05127109637602412
This function returns the square root of any given number.
sqrt of 20 is 4.47213595499958 sqrt of 14 is 3.7416573867739413 sqrt of 17.8995 is 4.230780069916185
This method returns e raised to the power of any number minus 1. e is the base of natural logarithm.
The given number (x) is : 0.2 e^x (using expml() function) is : 0.22140275816016985
It returns the cosine of any number, in radians.
Given angle : 1.0471975511965976 cos(x) is : 0.5000000000000001
It returns the sine of any number, in radians.
Given angle : 1.0471975511965976 sin(x) is : 0.8660254037844386
It returns the tangent of any number, in radians.
Given angle : 1.0471975511965976 tan(x) is : 1.7320508075688767