1 \section{Built-in Module
\sectcode{math
}}
4 \renewcommand{\indexsubitem}{(in module math)
}
5 This module is always available.
6 It provides access to the mathematical functions defined by the C
10 \begin{funcdesc
}{acos
}{x
}
13 \funcline{atan2
}{x, y
}
22 \funcline{hypot
}{x, y
}
23 \funcline{ldexp
}{x, y
}
35 \code{acos(
\varvars{x
})
},
36 \code{asin(
\varvars{x
})
},
37 \code{atan(
\varvars{x
})
},
38 \code{atan2(
\varvars{x\, y
})
},
39 \code{ceil(
\varvars{x
})
},
40 \code{cos(
\varvars{x
})
},
41 \code{cosh(
\varvars{x
})
},
42 \code{exp(
\varvars{x
})
},
43 \code{fabs(
\varvars{x
})
},
44 \code{floor(
\varvars{x
})
},
45 \code{fmod(
\varvars{x\, y
})
},
46 \code{frexp(
\varvars{x
})
},
47 \code{hypot(
\varvars{x\, y
})
},
48 \code{ldexp(
\varvars{x\, y
})
},
49 \code{log(
\varvars{x
})
},
50 \code{log10(
\varvars{x
})
},
51 \code{modf(
\varvars{x
})
},
52 \code{pow(
\varvars{x\, y
})
},
53 \code{sin(
\varvars{x
})
},
54 \code{sinh(
\varvars{x
})
},
55 \code{sqrt(
\varvars{x
})
},
56 \code{tan(
\varvars{x
})
},
57 \code{tanh(
\varvars{x
})
}.
60 Note that
\code{frexp
} and
\code{modf
} have a different call/return
61 pattern than their C equivalents: they take a single argument and
62 return a pair of values, rather than returning their second return
63 value through an `output parameter' (there is no such thing in Python).
65 The
\code{hypot
} function, which is not standard C, is not available
68 The module also defines two mathematical constants:
74 \code{pi
} and
\code{e
}.