Skip to content

math

Supported functions in the Python standard library math module.

acos(x: float) -> float

Compute the arccosine of x.

Parameters:

Name Type Description Default
x float

A value between -1 and 1.

required

Returns:

Type Description
float

The arccosine of x in radians.

asin(x: float) -> float

Compute the arcsine of x.

Parameters:

Name Type Description Default
x float

A value between -1 and 1.

required

Returns:

Type Description
float

The arcsine of x in radians.

atan(x: float) -> float

Compute the arctangent of x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
float

The arctangent of x in radians.

atan2(y: float, x: float) -> float

Compute the arctangent of y / x considering the quadrant.

Parameters:

Name Type Description Default
y float

The y-coordinate.

required
x float

The x-coordinate.

required

Returns:

Type Description
float

The arctangent of y / x in radians.

ceil(x: float) -> int

Return the smallest integer greater than or equal to x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
int

The ceiling of x.

cos(x: float) -> float

Compute the cosine of x.

Parameters:

Name Type Description Default
x float

The angle in radians.

required

Returns:

Type Description
float

The cosine of x.

cosh(x: float) -> float

Compute the hyperbolic cosine of x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
float

The hyperbolic cosine of x.

degrees(x: float) -> float

Convert radians to degrees.

Parameters:

Name Type Description Default
x float

An angle in radians.

required

Returns:

Type Description
float

The angle in degrees.

floor(x: float) -> int

Return the largest integer less than or equal to x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
int

The floor of x.

log(x: float, base: float = ...) -> float

Compute the logarithm of x to the given base.

Parameters:

Name Type Description Default
x float

The number for which to compute the logarithm.

required
base float

The base of the logarithm. If omitted, returns the natural logarithm of x.

...

Returns:

Type Description
float

The logarithm of x to the specified base.

radians(x: float) -> float

Convert degrees to radians.

Parameters:

Name Type Description Default
x float

An angle in degrees.

required

Returns:

Type Description
float

The angle in radians.

sin(x: float) -> float

Compute the sine of x.

Parameters:

Name Type Description Default
x float

The angle in radians.

required

Returns:

Type Description
float

The sine of x.

sinh(x: float) -> float

Compute the hyperbolic sine of x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
float

The hyperbolic sine of x.

sqrt(x: float) -> float

Compute the square root of x.

Parameters:

Name Type Description Default
x float

A non-negative numeric value.

required

Returns:

Type Description
float

The square root of x.

tan(x: float) -> float

Compute the tangent of x.

Parameters:

Name Type Description Default
x float

The angle in radians.

required

Returns:

Type Description
float

The tangent of x.

tanh(x: float) -> float

Compute the hyperbolic tangent of x.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
float

The hyperbolic tangent of x.

trunc(x: float) -> int

Truncate x to the nearest integer towards zero.

Parameters:

Name Type Description Default
x float

A numeric value.

required

Returns:

Type Description
int

The truncated integer value of x.