Python provides a powerful `math`

module that includes various mathematical functions, constants, and other utilities. This module is part of the Python Standard Library and provides access to mathematical functions that are available in the C standard library.

## Commonly Used Functions and Constants in the `math`

Module

### Constants

`math.pi`

: The mathematical constant π (pi), approximately 3.14159.`math.e`

: The mathematical constant e (Euler’s number), approximately 2.71828.

### Functions

#### Basic Functions

`math.sqrt(x)`

: Returns the square root of`x`

.`math.pow(x, y)`

: Returns`x`

raised to the power`y`

.`math.exp(x)`

: Returns e raised to the power`x`

.`math.log(x, base)`

: Returns the logarithm of`x`

to the specified`base`

. If the base is not specified, returns the natural logarithm (base e).`math.log10(x)`

: Returns the base-10 logarithm of`x`

.`math.log2(x)`

: Returns the base-2 logarithm of`x`

.

#### Trigonometric Functions

`math.sin(x)`

: Returns the sine of`x`

radians.`math.cos(x)`

: Returns the cosine of`x`

radians.`math.tan(x)`

: Returns the tangent of`x`

radians.`math.asin(x)`

: Returns the arc sine of`x`

in radians.`math.acos(x)`

: Returns the arc cosine of`x`

in radians.`math.atan(x)`

: Returns the arc tangent of`x`

in radians.`math.degrees(x)`

: Converts angle`x`

from radians to degrees.`math.radians(x)`

: Converts angle`x`

from degrees to radians.

#### Hyperbolic Functions

`math.sinh(x)`

: Returns the hyperbolic sine of`x`

.`math.cosh(x)`

: Returns the hyperbolic cosine of`x`

.`math.tanh(x)`

: Returns the hyperbolic tangent of`x`

.

#### Other Functions

`math.ceil(x)`

: Returns the smallest integer greater than or equal to`x`

.`math.floor(x)`

: Returns the largest integer less than or equal to`x`

.`math.fabs(x)`

: Returns the absolute value of`x`

.`math.factorial(x)`

: Returns the factorial of`x`

.`math.gcd(a, b)`

: Returns the greatest common divisor of`a`

and`b`

.

### Examples

Here are some examples demonstrating how to use functions from the `math`

module: