Next: time Prev: array Up: Built-in Modules Top: Top

3.5. Built-in Module math

This module is always available. It provides access to the mathematical functions defined by the C standard. They are:
acos (x) -- function of module math
asin (x) -- function of module math
atan (x) -- function of module math
atan2 (x, y) -- function of module math
ceil (x) -- function of module math
cos (x) -- function of module math
cosh (x) -- function of module math
exp (x) -- function of module math
fabs (x) -- function of module math
floor (x) -- function of module math
fmod (x, y) -- function of module math
frexp (x) -- function of module math
ldexp (x, y) -- function of module math
log (x) -- function of module math
log10 (x) -- function of module math
modf (x) -- function of module math
pow (x, y) -- function of module math
sin (x) -- function of module math
sinh (x) -- function of module math
sqrt (x) -- function of module math
tan (x) -- function of module math
tanh (x) -- function of module math
Note that frexp and modf have a different call/return pattern than their C equivalents: they take a single argument and return a pair of values, rather than returning their second return value through an `output parameter' (there is no such thing in Python).

The module also defines two mathematical constants:

pi -- data of module math
e -- data of module math