Math Module

christian.dinh2481 total contributions
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 float
s.
Math Module
- math.ceil()
- Takes in a numeric data type and rounds the value up to the nearest integer.
- math.cos()
- Returns the cosine of an angle.
- math.exp()
- Returns e raised to the power of x.
- math.log()
- Returns the natural logarithm of a number or the logarithm of a number to the given base.
- math.pow()
- Returns the float value of x raised to the power of y.
- math.sin()
- Returns the sine of input numeric x, measured in radian value.
- math.sqrt()
- Returns the square root of numeric input x.
- math.tan()
- Returns the tangent of input numeric x, measured in radians.
All contributors
- christian.dinh2481 total contributions
- Anonymous contributorAnonymous contributor3077 total contributions
- christian.dinh
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.