Math
The `math` module provides mathematical functions and constants beyond Python's built-in operators. The guide walks through Rounding & Comparison, Trigonometry, Combinatorics. `math.ceil()`, `math.floor()`, `math.trunc()` round in different directions. `math.isclose()` safely compares floating-point values. `math.isfinite()`, `isinf()`, `isnan()` check special values. `math.sin()`, `cos()`, `tan()` and their inverses `asin()`, `acos()`, `atan()` work in radians. `math.degrees()` and `math.radians()` convert between radians and degrees. `math.comb(n, k)` returns combinations (n choose k). `math.perm(n, k)` returns permutations. `math.factorial()` returns n!. `math.prod()` multiplies all elements in an iterable. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual functions covered by this guide in the Math Module category. Key APIs covered include math.ceil(), math.floor(), math.trunc(), math.fabs(), math.sqrt(), math.pow(). Related guides: builtins, string, list, dict, os. This is one of 48 Python guides on Python Reference — see the full list on the guides page.