Skip to content

Add disclaimer about availability of math functions #6110

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
merged 2 commits into from
Mar 4, 2022
Merged
Changes from all commits
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
65 changes: 52 additions & 13 deletions shared-bindings/math/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,55 +191,82 @@ MATH_FUN_2(pow, pow)
MATH_FUN_1(exp, exp)
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
//| 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)

//| 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))

//| 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))

//| 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)

//| 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)

//| 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)

//| 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)

//| 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)

//| 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)
Expand Down Expand Up @@ -281,25 +308,37 @@ MATH_FUN_2(ldexp, ldexp)
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS

//| 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)

//| 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)

//| 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)

//| 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)
Expand Down