]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Docs: Add a single table summary for ``cmath`` (GH-131887) (#132180)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 6 Apr 2025 23:43:06 +0000 (01:43 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 23:43:06 +0000 (23:43 +0000)
Docs: Add a single table summary for ``cmath`` (GH-131887)
(cherry picked from commit 6eaa4aeef25f77a31768d8ba5a03f614766aba95)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/library/cmath.rst

index 55035e0a16c6bb7dfec0b716e970341417acb2e0..4090e19762a8f5b6047009ca1252ec28548b2a4c 100644 (file)
@@ -38,6 +38,57 @@ the function is then applied to the result of the conversion.
       1.4142135623730951j
 
 
+====================================================  ============================================
+**Conversions to and from polar coordinates**
+--------------------------------------------------------------------------------------------------
+:func:`phase(z) <phase>`                              Return the phase of *z*
+:func:`polar(z) <polar>`                              Return the representation of *z* in polar coordinates
+:func:`rect(r, phi) <rect>`                           Return the complex number *z* with polar coordinates *r* and *phi*
+
+**Power and logarithmic functions**
+--------------------------------------------------------------------------------------------------
+:func:`exp(z) <exp>`                                  Return *e* raised to the power *z*
+:func:`log(z[, base]) <log>`                          Return the logarithm of *z* to the given *base* (*e* by default)
+:func:`log10(z) <log10>`                              Return the base-10 logarithm of *z*
+:func:`sqrt(z) <sqrt>`                                Return the square root of *z*
+
+**Trigonometric functions**
+--------------------------------------------------------------------------------------------------
+:func:`acos(z) <acos>`                                Return the arc cosine of *z*
+:func:`asin(z) <asin>`                                Return the arc sine of *z*
+:func:`atan(z) <atan>`                                Return the arc tangent of *z*
+:func:`cos(z) <cos>`                                  Return the cosine of *z*
+:func:`sin(z) <sin>`                                  Return the sine of *z*
+:func:`tan(z) <tan>`                                  Return the tangent of *z*
+
+**Hyperbolic functions**
+--------------------------------------------------------------------------------------------------
+:func:`acosh(z) <acosh>`                              Return the inverse hyperbolic cosine of *z*
+:func:`asinh(z) <asinh>`                              Return the inverse hyperbolic sine of *z*
+:func:`atanh(z) <atanh>`                              Return the inverse hyperbolic tangent of *z*
+:func:`cosh(z) <cosh>`                                Return the hyperbolic cosine of *z*
+:func:`sinh(z) <sinh>`                                Return the hyperbolic sine of *z*
+:func:`tanh(z) <tanh>`                                Return the hyperbolic tangent of *z*
+
+**Classification functions**
+--------------------------------------------------------------------------------------------------
+:func:`isfinite(z) <isfinite>`                        Check if all components of *z* are finite
+:func:`isinf(z) <isinf>`                              Check if any component of *z* is infinite
+:func:`isnan(z) <isnan>`                              Check if any component of *z* is a NaN
+:func:`isclose(a, b, *, rel_tol, abs_tol) <isclose>`  Check if the values *a* and *b* are close to each other
+
+**Constants**
+--------------------------------------------------------------------------------------------------
+:data:`pi`                                            *π* = 3.141592...
+:data:`e`                                             *e* = 2.718281...
+:data:`tau`                                           *τ* = 2\ *π* = 6.283185...
+:data:`inf`                                           Positive infinity
+:data:`infj`                                          Pure imaginary infinity
+:data:`nan`                                           "Not a number" (NaN)
+:data:`nanj`                                          Pure imaginary NaN
+====================================================  ============================================
+
+
 Conversions to and from polar coordinates
 -----------------------------------------