math
import math
This module contains functions and constants to make trigonometric and
non-trigonometric mathematics a breeze. The module also defines a couple
of commonly used scientific and mathematical constants such as PI.
The math API
Every public name in math, wherever it is declared. Each links to the
page that documents it.
| Name | Kind | Summary |
|---|---|---|
math.E | constant | represents Euler’s number, the base of natural logarithms |
math.Infinity | constant | Mathematical infinity |
math.LOG_10 | constant | represents the natural logarithm of 10 |
math.LOG_10_E | constant | represents the base 10 logarithm of e |
math.LOG_2 | constant | represents the natural logarithm of 2 |
math.LOG_2_E | constant | represents the base 2 logarithm of e |
math.NaN | constant | Mathematical NaN |
math.PI | constant | represents the ratio of the circumference of a circle to its diameter |
math.ROOT_2 | constant | represents the square root of 2 |
math.ROOT_3 | constant | represents the square root of 3 |
math.ROOT_HALF | constant | represents the square root of 1/2 |
Constants
PI
math.PI
represents the ratio of the circumference of a circle to its diameter
E
math.E
represents Euler’s number, the base of natural logarithms
LOG_10
math.LOG_10
represents the natural logarithm of 10
LOG_10_E
math.LOG_10_E
represents the base 10 logarithm of e
LOG_2
math.LOG_2
represents the natural logarithm of 2
LOG_2_E
math.LOG_2_E
represents the base 2 logarithm of e
ROOT_2
math.ROOT_2
represents the square root of 2
ROOT_3
math.ROOT_3
represents the square root of 3
ROOT_HALF
math.ROOT_HALF
represents the square root of 1/2
Infinity
math.Infinity
Mathematical infinity
NaN
math.NaN
Mathematical NaN
2021, Richard Ore and Zuri contributors