cmath – Mathematical functions for complex numbers.
Mathematical functions for complex numbers.
This module implements a subset of the corresponding CPython module,
as described below. For more information, refer to the original
CPython documentation: cmath
.
The cmath
module provides some basic mathematical functions for
working with complex numbers.
Availability: not available on WiPy and ESP8266. Floating point support required for this module.
Attributes
base of the natural logarithm |
|
the ratio of a circle's circumference to its diameter |
Functions
|
Return the cosine of |
|
Return the exponential of |
|
Return the natural logarithm of |
|
Return the base-10 logarithm of |
|
Returns the phase of the number |
|
Returns, as a tuple, the polar form of |
|
Returns the complex number with modulus |
|
Return the sine of |
|
Return the square-root of |
Module Contents
- cmath.log(z) float
Return the natural logarithm of
z
. The branch cut is along the negative real axis.
- cmath.log10(z) float
Return the base-10 logarithm of
z
. The branch cut is along the negative real axis.
- cmath.polar(z) Tuple
Returns, as a tuple, the polar form of
z
.
- cmath.sqrt(z) Incomplete
Return the square-root of
z
.