Merge pull request #6110 from tekktrik/doc/document-special-math-funcs

Add disclaimer about availability of math functions
This commit is contained in:
Scott Shawcroft 2022-03-04 10:40:27 -08:00 committed by GitHub
commit 9265cca752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,55 +191,82 @@ MATH_FUN_2(pow, pow)
MATH_FUN_1(exp, exp) MATH_FUN_1(exp, exp)
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
//| def expm1(x: float) -> float: //| def expm1(x: float) -> float:
//| """Return ``exp(x) - 1``.""" //| """Return ``exp(x) - 1``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(expm1, expm1) MATH_FUN_1(expm1, expm1)
//| def log2(x: float) -> float: //| def log2(x: float) -> float:
//| """Return the base-2 logarithm of ``x``.""" //| """Return the base-2 logarithm of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1_ERRCOND(log2, log2, (x <= (mp_float_t)0.0)) MATH_FUN_1_ERRCOND(log2, log2, (x <= (mp_float_t)0.0))
//| def log10(x: float) -> float: //| def log10(x: float) -> float:
//| """Return the base-10 logarithm of ``x``.""" //| """Return the base-10 logarithm of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1_ERRCOND(log10, log10, (x <= (mp_float_t)0.0)) MATH_FUN_1_ERRCOND(log10, log10, (x <= (mp_float_t)0.0))
//| def cosh(x: float) -> float: //| def cosh(x: float) -> float:
//| """Return the hyperbolic cosine of ``x``.""" //| """Return the hyperbolic cosine of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(cosh, cosh) MATH_FUN_1(cosh, cosh)
//| def sinh(x: float) -> float: //| def sinh(x: float) -> float:
//| """Return the hyperbolic sine of ``x``.""" //| """Return the hyperbolic sine of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(sinh, sinh) MATH_FUN_1(sinh, sinh)
//| def tanh(x: float) -> float: //| def tanh(x: float) -> float:
//| """Return the hyperbolic tangent of ``x``.""" //| """Return the hyperbolic tangent of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(tanh, tanh) MATH_FUN_1(tanh, tanh)
//| def acosh(x: float) -> float: //| def acosh(x: float) -> float:
//| """Return the inverse hyperbolic cosine of ``x``.""" //| """Return the inverse hyperbolic cosine of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(acosh, acosh) MATH_FUN_1(acosh, acosh)
//| def asinh(x: float) -> float: //| def asinh(x: float) -> float:
//| """Return the inverse hyperbolic sine of ``x``.""" //| """Return the inverse hyperbolic sine of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(asinh, asinh) MATH_FUN_1(asinh, asinh)
//| def atanh(x: float) -> float: //| def atanh(x: float) -> float:
//| """Return the inverse hyperbolic tangent of ``x``.""" //| """Return the inverse hyperbolic tangent of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(atanh, atanh) MATH_FUN_1(atanh, atanh)
@ -281,25 +308,37 @@ MATH_FUN_2(ldexp, ldexp)
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS #if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
//| def erf(x: float) -> float: //| def erf(x: float) -> float:
//| """Return the error function of ``x``.""" //| """Return the error function of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(erf, erf) MATH_FUN_1(erf, erf)
//| def erfc(x: float) -> float: //| def erfc(x: float) -> float:
//| """Return the complementary error function of ``x``.""" //| """Return the complementary error function of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(erfc, erfc) MATH_FUN_1(erfc, erfc)
//| def gamma(x: float) -> float: //| def gamma(x: float) -> float:
//| """Return the gamma function of ``x``.""" //| """Return the gamma function of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(gamma, tgamma) MATH_FUN_1(gamma, tgamma)
//| def lgamma(x: float) -> float: //| def lgamma(x: float) -> float:
//| """Return the natural logarithm of the gamma function of ``x``.""" //| """Return the natural logarithm of the gamma function of ``x``.
//|
//| May not be available on some boards.
//| """
//| ... //| ...
//| //|
MATH_FUN_1(lgamma, lgamma) MATH_FUN_1(lgamma, lgamma)