math -- Mathematical functions. =============================== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/math/__init__.pyi .. py:module:: math .. autoapi-nested-parse:: Mathematical functions. |see_cpython_module| :mod:`python:math`. The ``math`` module provides some basic mathematical functions for working with floating-point numbers. *Note:* On the pyboard, floating-point numbers have 32-bit precision. Availability: not available on WiPy. Floating point support required for this module. Attributes ---------- .. autoapisummary:: math.e math.pi Functions --------- .. autoapisummary:: math.acos math.acosh math.asin math.asinh math.atan math.atan2 math.atanh math.ceil math.copysign math.cos math.cosh math.degrees math.erf math.erfc math.exp math.expm1 math.fabs math.floor math.fmod math.frexp math.gamma math.isfinite math.isinf math.isnan math.ldexp math.lgamma math.log math.log10 math.log2 math.modf math.pow math.radians math.sin math.sinh math.sqrt math.tan math.tanh math.trunc Module Contents --------------- .. py:function:: acos(x) -> float Return the inverse cosine of ``x``. .. py:function:: acosh(x) -> float Return the inverse hyperbolic cosine of ``x``. .. py:function:: asin(x) -> float Return the inverse sine of ``x``. .. py:function:: asinh(x) -> float Return the inverse hyperbolic sine of ``x``. .. py:function:: atan(x) -> float Return the inverse tangent of ``x``. .. py:function:: atan2(y, x) -> float Return the principal value of the inverse tangent of ``y/x``. .. py:function:: atanh(x) -> float Return the inverse hyperbolic tangent of ``x``. .. py:function:: ceil(x) -> int Return an integer, being ``x`` rounded towards positive infinity. .. py:function:: copysign(x, y) -> _typeshed.Incomplete Return ``x`` with the sign of ``y``. .. py:function:: cos(x) -> float Return the cosine of ``x``. .. py:function:: cosh(x) -> float Return the hyperbolic cosine of ``x``. .. py:function:: degrees(x) -> _typeshed.Incomplete Return radians ``x`` converted to degrees. .. py:function:: erf(x) -> _typeshed.Incomplete Return the error function of ``x``. .. py:function:: erfc(x) -> _typeshed.Incomplete Return the complementary error function of ``x``. .. py:function:: exp(x) -> float Return the exponential of ``x``. .. py:function:: expm1(x) -> _typeshed.Incomplete Return ``exp(x) - 1``. .. py:function:: fabs(x) -> _typeshed.Incomplete Return the absolute value of ``x``. .. py:function:: floor(x) -> int Return an integer, being ``x`` rounded towards negative infinity. .. py:function:: fmod(x, y) -> _typeshed.Incomplete Return the remainder of ``x/y``. .. py:function:: frexp(x) -> _typeshed.Incomplete Decomposes a floating-point number into its mantissa and exponent. The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e`` exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise the relation ``0.5 <= abs(m) < 1`` holds. .. py:function:: gamma(x) -> _typeshed.Incomplete Return the gamma function of ``x``. .. py:function:: isfinite(x) -> bool Return ``True`` if ``x`` is finite. .. py:function:: isinf(x) -> bool Return ``True`` if ``x`` is infinite. .. py:function:: isnan(x) -> bool Return ``True`` if ``x`` is not-a-number .. py:function:: ldexp(x, exp) -> _typeshed.Incomplete Return ``x * (2**exp)``. .. py:function:: lgamma(x) -> float Return the natural logarithm of the gamma function of ``x``. .. py:function:: log(x) -> float Return the natural logarithm of ``x``. .. py:function:: log10(x) -> float Return the base-10 logarithm of ``x``. .. py:function:: log2(x) -> float Return the base-2 logarithm of ``x``. .. py:function:: modf(x) -> Tuple Return a tuple of two floats, being the fractional and integral parts of ``x``. Both return values have the same sign as ``x``. .. py:function:: pow(x, y) -> _typeshed.Incomplete Returns ``x`` to the power of ``y``. .. py:function:: radians(x) -> _typeshed.Incomplete Return degrees ``x`` converted to radians. .. py:function:: sin(x) -> float Return the sine of ``x``. .. py:function:: sinh(x) -> float Return the hyperbolic sine of ``x``. .. py:function:: sqrt(x) -> _typeshed.Incomplete Return the square root of ``x``. .. py:function:: tan(x) -> float Return the tangent of ``x``. .. py:function:: tanh(x) -> float Return the hyperbolic tangent of ``x``. .. py:function:: trunc(x) -> int Return an integer, being ``x`` rounded towards 0. .. py:data:: e :type: float base of the natural logarithm .. py:data:: pi :type: float the ratio of a circle's circumference to its diameter