Skip to content

math

Supported functions in the Python standard library math module.

acos(x)

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)

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)

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, x)

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)

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)

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)

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.

floor(x)

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, base=...)

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.

sin(x)

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)

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.

tan(x)

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)

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)

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.