Math Module

Published Jul 30, 2021Updated Sep 9, 2021
Contribute to Docs

Python has a built-in math module that we can use for mathematical tasks. This module provides access to the mathematical functions defined by the C standard.

The following functions are provided by this module. Except when explicitly noted otherwise, all return values are floats.

Math Module

Takes in a numeric data type and rounds the value up to the nearest integer.
Returns the cosine of an angle.
Returns e raised to the power of x.
Returns the natural logarithm of a number or the logarithm of a number to the given base.
Returns the float value of x raised to the power of y.
Returns the sine of input numeric x, measured in radian value.
Returns the square root of numeric input x.
Returns the tangent of input numeric x, measured in radians.

All contributors

Looking to contribute?

Learn Python on Codecademy