cpython-withatomic / Doc / libmath.tex

\section{Built-in Module \sectcode{math}}

\renewcommand{\indexsubitem}{(in module math)}
This module is always available.
It provides access to the mathematical functions defined by the C
They are:
\funcline{atan2}{x, y}
\funcline{fmod}{x, y}
\funcline{ldexp}{x, y}
\funcline{pow}{x, y}
\code{atan2(\varvars{x\, y})},
\code{fmod(\varvars{x\, y})},
\code{ldexp(\varvars{x\, y})},
\code{pow(\varvars{x\, y})},

Note that \code{frexp} and \code{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:
\code{pi} and \code{e}.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.