Home >>Python cmath Module
A complex number is created from two real numbers and the return value has an imaginary part of 0. This cmath module has a set of methods and constants.
cMath MethodsMethod | Description |
---|---|
cmath.acos(x) | This method is used to returns the arc cosine value of x |
cmath.acosh(x) | It is used to returns the hyperbolic arc cosine of x |
cmath.asin(x) | It Returns the arc sine of x |
cmath.asinh(x) | It is used to returns the hyperbolic arc sine of x |
cmath.atan(x) | This method is used to returns the arc tangent value of x |
cmath.atanh(x) | It is used to returns the hyperbolic arctangent value of number |
cmath.cos(x) | This method is used to returns the cosine of x |
cmath.cosh(x) | This method is used to returns the hyperbolic cosine of x |
cmath.exp(x) | This method is used to returns the value of Ex, where E is the Euler's number |
cmath.isclose() | It is used to checks whether two values are close, or not |
cmath.isfinite(x) | It is used to checks whether x is a finite number |
cmath.isinf(x) | This method is used to checks whether x is a positive or negative infinity |
cmath.isnan(x) | This method is used to checks whether x is NaN (not a number) |
cmath.log(x[, base]) | It is used to returns the logarithm of x to the base |
cmath.log10(x) | This method is used to returns the base-10 logarithm of x |
cmath.phase() | It is used to return the phase of a complex number |
cmath.polar() | This method is used to convert a complex number to polar coordinates |
cmath.rect() | This method is used to convert polar coordinates to rectangular form |
cmath.sin(x) | It is used to returns the sine of x |
cmath.sinh(x) | It is used to returns the hyperbolic sine of x |
cmath.sqrt(x) | This method Returns the square root |
cmath.tan(x) | It is used to returns the tangent of x |
cmath.tanh(x) | It is used to returns the hyperbolic tangent of x |
Constant | Description |
---|---|
cmath.e | This constant rteurns Euler's number |
cmath.inf | It is used to returns a floating-point positive infinity value |
cmath.infj | It is used to returns a complex infinity value |
cmath.nan | It is used to returns floating-point NaN (Not a Number) value |
cmath.nanj | This method returns coplext NaN (Not a Number) value |
cmath.pi | This method returns PI (3.1415...) |
cmath.tau | It is used to returns tau (6.2831...) |