O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

cmath

The cmath module provides mathematical functions for complex numbers. All the following functions accept and return complex numbers:

FunctionDescription
acos(x)Returns the arccosine of x
acosh(x)Returns the arc hyperbolic cosine of x
asin(x)Returns the arcsine of x
asinh(x)Returns the arc hyperbolic sine of x
atan(x)Returns the arctangent of x
atanh(x)Returns the arc hyperbolic tangent of x
cos(x)Returns the cosine of x
cosh(x)Returns the hyperbolic cosine of x
exp(x)Returns e **x
log(x [,base])Returns the logarithm of x in the given base. If base is omitted, the natural logarithm is computed.
log10(x)Returns the base 10 logarithm of x
sin(x)Returns the sine of x
sinh(x)Returns the hyperbolic sine of x
sqrt(x)Returns the square root of x
tan(x)Returns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required