cmath -- Mathematical functions for complex numbers. ==================================================== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/cmath/__init__.pyi .. py:module:: cmath .. autoapi-nested-parse:: Mathematical functions for complex numbers. |see_cpython_module| :mod:`python: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 ---------- .. autoapisummary:: cmath.e cmath.pi Functions --------- .. autoapisummary:: cmath.cos cmath.exp cmath.log cmath.log10 cmath.phase cmath.polar cmath.rect cmath.sin cmath.sqrt Module Contents --------------- .. py:function:: cos(z) -> float Return the cosine of ``z``. .. py:function:: exp(z) -> float Return the exponential of ``z``. .. py:function:: log(z) -> float Return the natural logarithm of ``z``. The branch cut is along the negative real axis. .. py:function:: log10(z) -> float Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis. .. py:function:: phase(z) -> float Returns the phase of the number ``z``, in the range (-pi, +pi]. .. py:function:: polar(z) -> Tuple Returns, as a tuple, the polar form of ``z``. .. py:function:: rect(r, phi) -> float Returns the complex number with modulus ``r`` and phase ``phi``. .. py:function:: sin(z) -> float Return the sine of ``z``. .. py:function:: sqrt(z) -> _typeshed.Incomplete Return the square-root of ``z``. .. py:data:: e :type: float base of the natural logarithm .. py:data:: pi :type: float the ratio of a circle's circumference to its diameter