cmath
cmath is a standard library module in the Python programming language that provides mathematical functions for complex numbers. It is designed as a counterpart to the real-number-focused math module and operates on Python’s built-in complex type. Functions in cmath accept complex inputs and return complex results; when given real numbers, they are promoted to complex form automatically.
The module exposes a broad range of functions, including exponential, logarithmic, square root, trigonometric, and hyperbolic
Behavior differences from the real-number math module include how domain issues are handled. Because cmath operates
In broader programming contexts, the name cmath also appears in other languages with similar roles. In C