Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add arguments in the table
  • Loading branch information
Nodd committed Oct 22, 2024
commit fb37008ff7f651d3beeee8fb7a606826c7a7ae15
142 changes: 71 additions & 71 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,90 +26,90 @@ 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
Contributor

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.
--------------------------------------------------------------------------------------------------
: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` 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.
--------------------------------------------------------------------------------------------------
: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) <pow>` *x* raised to the power *y*.
:func:`sqrt(x) <sqrt>` Square root of *x*.

**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.
--------------------------------------------------------------------------------------------------
: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.
:func:`sin(x) <sin>` Sine of *x*.
:func:`tan(x) <tan>` Tangent of *x*.

**Angular conversion**
----------------------------------------------------------------------------------------
:func:`degrees` Convert angle from radians to degrees.
:func:`radians` Convert angle from degrees to radians.
--------------------------------------------------------------------------------------------------
: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` 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.
--------------------------------------------------------------------------------------------------
: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` `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>`_.
--------------------------------------------------------------------------------------------------
: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).
======================= ===============================================================
--------------------------------------------------------------------------------------------------
: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
Expand Down