Numerical Standard Library Modules

math — standard library module

Real-valued mathematical functions for integer combinatorics, floating-point calculations, angles and special functions. Use cmath for complex-valued results.

Formal Syntax & Structure

python syntaxpython
import math

Return Value

Not applicable

Import binds a module name; individual APIs determine results.

Working Example

Example Snippetpython
import mathprint(math.isqrt(80), math.gcd(18, 24))
Python Reference