Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Add a single table as summary to math documentation #125810

Merged
merged 10 commits into from
Nov 1, 2024
86 changes: 86 additions & 0 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,92 @@ The following functions are provided by this module. Except when explicitly
noted otherwise, all return values are floats.


======================= ===============================================================
**Number-theoretic and representation functions**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be split out.

For some inspiration you could take look on the C17 and sections in the Annex F.10, e.g. here: https://en.cppreference.com/w/c/numeric/math. So, we should have something like 1) "Floating-point manipulation functions", 2) "Classification and comparison", 3) "Nearest integer operations", 4) "Basic operations" (maybe prod/fsum/etc - should be here).

Number-theoretic/combinatorial functions deserve a separate section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion. I simply used the current organization of the page, and copied the existing section labels in the page. I think that reorganizing the whole page can be made in another PR, to focus this one on adding the table. I can do it afterwards.

----------------------------------------------------------------------------------------
:func:`ceil` Ceiling of *x*, the smallest integer greater than or equal to *x*.
:func:`comb` Number of ways to choose *k* items from *n* items without repetition and without order.
:func:`copysign` Magnitude (absolute value) of *x* with the sign of *y*.
:func:`fabs` Absolute value.
:func:`factorial` *n* factorial.
:func:`floor` Floor of *x*, the largest integer less than or equal to *x*.
:func:`fma` Fused multiply-add operation.
:func:`fmod` Remainder of division.
:func:`frexp` Mantissa and exponent.
:func:`fsum` Accurate floating-point sum of values.
:func:`gcd` Greatest common divisor.
:func:`isclose` Check if the values *a* and *b* are close to each other.
:func:`isfinite` Check if *x* is neither an infinity nor a NaN.
:func:`isinf` Check if if *x* is a positive or negative infinity.
:func:`isnan` Check if if *x* is a NaN (not a number).
:func:`isqrt` Integer square root of a nonnegative integer.
:func:`lcm` Least common multiple.
:func:`ldexp` inverse of function :func:`frexp`.
:func:`modf` Fractional and integer parts.
:func:`nextafter` Floating-point value *steps* steps after *x* towards *y*.
:func:`perm` Number of ways to choose *k* items from *n* items without repetition and with order.
:func:`prod` Product of all the elements.
:func:`remainder` Remainder of *x* with respect to *y*.
:func:`sumprod` Sum of products from two iterables.
:func:`trunc` Integer part.
:func:`ulp` Value of the least significant bit.

**Power and logarithmic functions**
----------------------------------------------------------------------------------------
:func:`cbrt` Cube root.
:func:`exp` *e* raised to the power *x*.
:func:`exp2` *2* raised to the power *x*.
:func:`expm1` *e* raised to the power *x*, minus 1.
:func:`log` Logarithm of *x* to the given base (*e* by default).
:func:`log1p` Natural logarithm of *1+x* (base *e*).
:func:`log2` Base-2 logarithm.
:func:`log10` Base-10 logarithm.
:func:`pow` ``x`` raised to the power ``y``.
:func:`sqrt` Square root.

**Trigonometric functions**
----------------------------------------------------------------------------------------
:func:`acos` Arc cosine.
:func:`asin` Arc sine.
:func:`atan` Arc tangent.
:func:`atan2` ``atan(y / x)``.
:func:`cos` Cosine.
:func:`dist` Euclidean distance.
:func:`hypot` Euclidean norm.
:func:`sin` Sine.
:func:`tan` Tangent.

**Angular conversion**
----------------------------------------------------------------------------------------
:func:`degrees` Convert angle from radians to degrees.
:func:`radians` Convert angle from degrees to radians.

**Hyperbolic functions**
----------------------------------------------------------------------------------------
:func:`acosh` Inverse hyperbolic cosine.
:func:`asinh` Inverse hyperbolic sine.
:func:`atanh` Inverse hyperbolic tangent.
:func:`cosh` Hyperbolic cosine.
:func:`sinh` Hyperbolic sine.
:func:`tanh` Hyperbolic tangent.

**Special functions**
----------------------------------------------------------------------------------------
:func:`erf` `Error function <https://en.wikipedia.org/wiki/Error_function>`_.
:func:`erfc` `Complementary error function <https://en.wikipedia.org/wiki/Error_function>`_.
:func:`gamma` `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_.
:func:`lgamma` Natural logarithm of the absolute value of the `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_.

**Constants**
----------------------------------------------------------------------------------------
:data:`pi` *π* = 3.141592...
:func:`e` *e* = 2.718281...
:func:`tau` *τ* = 2\ *π* = 6.283185....
:func:`inf` Positive infinity.
:func:`nan` "Not a number" (NaN).
merwok marked this conversation as resolved.
Show resolved Hide resolved
======================= ===============================================================


Number-theoretic and representation functions
---------------------------------------------

Expand Down
Loading