Q2)Explain any 5 math functions in python in detail?
The math module is a standard module in python and is
always available .To use mathematical functions under this
module you have to import the module using import math and
call the functions as math.functions_name(Parameter) .
Eg. import math
Print math.cell(20.3)
>>>math.cell(20.3)
21.0
>>>
These functions cannot be used with complex numbers.the
following functions are provided by this module:
**NUMBER-THEORETIC AND REPRESENTATION
FUNCTIONS
1)math.ceil(x)-It returns the smallest integer greater than x.
2)math.copysign(x,y)-It returns x with the sign of y
3)math.floor(x)-It returns the floor of x as a float,the largest
integer value less than or equal to x
**HYPERBOLIC FUNCTIONS
1)math.acosh(x)-It returns the inverse hyperbolic cosine of x.
2)math.asinh(x)-It returns the inverse hyperbolic sine of x.
3)math.atanh(x)-It returns the inverse hyperbolic tan of x.
**SPECIAL FUNCTIONS
1)math.erf(x)-It return the error function of x.
2)math.erfc(x)-It return the complementary error function at x
**ANGULAR CONVERSION
1)math.degrees(x)-Convert angle x from radians to degrees
2)math.radians(x)-Convert angle x from degrees to radians
**TRIGONOMETRIC FUNCTIONS
1)math.acos(x)-Return the arc cosine of x ,in radians
2)math.asin(x)-Return the arc sine of x ,in radians
**CONSTANTS
1)pi-Represents a Mathematical constant, the ratio of
circumference of a circle to it diameter(3.14159…)
2)E-Standard Mathematical constant e (2.71828…)
**LOGARITHMIC FUNCTIONS
1)log1p(x)- It returns the natural logarithm of 1+x
2)log 2(x)-It returns the base-2 logarithm of x
3)log10(x)-It returns the base-10 logarithm of x.