Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Doc: Add a single table as summary to math documentation#125810
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
10 commits Select commit Hold shift + click to select a range
51c9e75 Summary for math module with separate tables
Nodd 5cf795a Forgot remainder description
Nodd d06e257 Single table
Nodd f817b9e data instead of func
Nodd fb37008 Add arguments in the table
Nodd 8197fed Fix inconsistencies in pow documentation
Nodd 63ce52c Remove full stops from the table
Nodd c4a8424 Fix math.pow link
Nodd eed482a Fix spacing
Nodd 4c408d5 Merge branch 'main' into doc_math_monosummary
Nodd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`ceil(x) <ceil>` Ceiling of *x*, the smallest integer greater than or equal to *x* | ||
| :func:`comb(n, k) <comb>` Number of ways to choose *k* items from *n* items without repetition and without order | ||
| :func:`copysign(x, y) <copysign>` Magnitude (absolute value) of *x* with the sign of *y* | ||
| :func:`fabs(x) <fabs>` Absolute value of *x* | ||
| :func:`factorial(n) <factorial>` *n* factorial | ||
| :func:`floor (x) <floor>` Floor of *x*, the largest integer less than or equal to *x* | ||
| :func:`fma(x, y, z) <fma>` Fused multiply-add operation: ``(x * y) + z`` | ||
| :func:`fmod(x, y) <fmod>` Remainder of division ``x / y`` | ||
| :func:`frexp(x) <frexp>` Mantissa and exponent of *x* | ||
| :func:`fsum(iterable) <fsum>` Sum of values in the input *iterable* | ||
| :func:`gcd(*integers) <gcd>` Greatest common divisor of the integer arguments | ||
| :func:`isclose(a, b, rel_tol, abs_tol) <isclose>` Check if the values *a* and *b* are close to each other | ||
| :func:`isfinite(x) <isfinite>` Check if *x* is neither an infinity nor a NaN | ||
| :func:`isinf(x) <isinf>` Check if *x* is a positive or negative infinity | ||
| :func:`isnan(x) <isnan>` Check if *x* is a NaN (not a number) | ||
| :func:`isqrt(n) <isqrt>` Integer square root of a nonnegative integer *n* | ||
| :func:`lcm(*integers) <lcm>` Least common multiple of the integer arguments | ||
| :func:`ldexp(x, i) <ldexp>` ``x * (2**i)``, inverse of function :func:`frexp` | ||
| :func:`modf(x) <modf>` Fractional and integer parts of *x* | ||
| :func:`nextafter(x, y, steps) <nextafter>` Floating-point value *steps* steps after *x* towards *y* | ||
| :func:`perm(n, k) <perm>` Number of ways to choose *k* items from *n* items without repetition and with order | ||
| :func:`prod(iterable, start) <prod>` Product of elements in the input *iterable* with a *start* value | ||
| :func:`remainder(x, y) <remainder>` Remainder of *x* with respect to *y* | ||
| :func:`sumprod(p, q) <sumprod>` Sum of products from two iterables *p* and *q* | ||
| :func:`trunc(x) <trunc>` Integer part of *x* | ||
| :func:`ulp(x) <ulp>` Value of the least significant bit of *x* | ||
| **Power and logarithmic functions** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`cbrt(x) <cbrt>` Cube root of *x* | ||
| :func:`exp(x) <exp>` *e* raised to the power *x* | ||
| :func:`exp2(x) <exp2>` *2* raised to the power *x* | ||
| :func:`expm1(x) <expm1>` *e* raised to the power *x*, minus 1 | ||
| :func:`log(x, base) <log>` Logarithm of *x* to the given base (*e* by default) | ||
| :func:`log1p(x) <log1p>` Natural logarithm of *1+x* (base *e*) | ||
| :func:`log2(x) <log2>` Base-2 logarithm of *x* | ||
| :func:`log10(x) <log10>` Base-10 logarithm of *x* | ||
| :func:`pow(x, y) <math.pow>` *x* raised to the power *y* | ||
| :func:`sqrt(x) <sqrt>` Square root of *x* | ||
| **Trigonometric functions** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`acos(x) <acos>` Arc cosine of *x* | ||
| :func:`asin(x) <asin>` Arc sine of *x* | ||
| :func:`atan(x) <atan>` Arc tangent of *x* | ||
| :func:`atan2(y, x) <atan2>` ``atan(y / x)`` | ||
| :func:`cos(x) <cos>` Cosine of *x* | ||
| :func:`dist(p, q) <dist>` Euclidean distance between two points *p* and *q* given as an iterable of coordinates | ||
| :func:`hypot(*coordinates) <hypot>` Euclidean norm of an iterable of coordinates | ||
skirpichev marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| :func:`sin(x) <sin>` Sine of *x* | ||
| :func:`tan(x) <tan>` Tangent of *x* | ||
| **Angular conversion** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`degrees(x) <degrees>` Convert angle *x* from radians to degrees | ||
| :func:`radians(x) <radians>` Convert angle *x* from degrees to radians | ||
| **Hyperbolic functions** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`acosh(x) <acosh>` Inverse hyperbolic cosine of *x* | ||
| :func:`asinh(x) <asinh>` Inverse hyperbolic sine of *x* | ||
| :func:`atanh(x) <atanh>` Inverse hyperbolic tangent of *x* | ||
| :func:`cosh(x) <cosh>` Hyperbolic cosine of *x* | ||
| :func:`sinh(x) <sinh>` Hyperbolic sine of *x* | ||
| :func:`tanh(x) <tanh>` Hyperbolic tangent of *x* | ||
| **Special functions** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :func:`erf(x) <erf>` `Error function <https://en.wikipedia.org/wiki/Error_function>`_ at *x* | ||
| :func:`erfc(x) <erfc>` `Complementary error function <https://en.wikipedia.org/wiki/Error_function>`_ at *x* | ||
| :func:`gamma(x) <gamma>` `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_ at *x* | ||
| :func:`lgamma(x) <lgamma>` Natural logarithm of the absolute value of the `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_ at *x* | ||
| **Constants** | ||
| -------------------------------------------------------------------------------------------------- | ||
| :data:`pi` *π* = 3.141592... | ||
| :data:`e` *e* = 2.718281... | ||
| :data:`tau` *τ* = 2\ *π* = 6.283185... | ||
| :data:`inf` Positive infinity | ||
| :data:`nan` "Not a number" (NaN) | ||
| ==================================================== ============================================ | ||
| Number-theoretic and representation functions | ||
| --------------------------------------------- | ||
| @@ -447,11 +533,11 @@ Power and logarithmic functions | ||
| .. function:: pow(x, y) | ||
| Return ``x`` raised to the power ``y``. Exceptional cases follow | ||
| Return *x* raised to the power *y*. Exceptional cases follow | ||
| the IEEE 754 standard as far as possible. In particular, | ||
| ``pow(1.0, x)`` and ``pow(x, 0.0)`` always return ``1.0``, even | ||
| when ``x`` is a zero or a NaN. If both ``x`` and ``y`` are finite, | ||
| ``x`` is negative, and ``y`` is not an integer then ``pow(x, y)`` | ||
| when *x* is a zero or a NaN. If both *x* and *y* are finite, | ||
| *x* is negative, and *y* is not an integer then ``pow(x, y)`` | ||
| is undefined, and raises :exc:`ValueError`. | ||
| Unlike the built-in ``**`` operator, :func:`math.pow` converts both | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.