micropython/docs/library/math.rst

146 lines
1.7 KiB
ReStructuredText
Raw Normal View History

:mod:`math` --- mathematical functions
======================================
.. module:: math
:synopsis: mathematical functions
The ``math`` module provides some basic mathematical funtions for
working with floating-point numbers.
Functions
---------
.. function:: acos(x)
.. function:: acosh(x)
.. function:: asin(x)
.. function:: asinh(x)
.. function:: atan(x)
.. function:: atan2(y, x)
.. function:: atanh(x)
.. function:: ceil(x)
.. function:: copysign(x, y)
.. function:: cos(x)
.. function:: cosh(x)
.. function:: degrees(x)
.. function:: erf(x)
Return the error function of ``x``.
.. function:: erfc(x)
Return the complementary error function of ``x``.
.. function:: exp(x)
.. function:: expm1(x)
.. function:: fabs(x)
.. function:: floor(x)
.. function:: fmod(x, y)
.. function:: frexp(x)
Converts a floating-point number to fractional and integral components.
.. function:: gamma(x)
Return the gamma function of ``x``.
.. function:: isfinite(x)
.. function:: isinf(x)
.. function:: isnan(x)
.. function:: ldexp(x, exp)
.. function:: lgamma(x)
return the natural logarithm of the gamma function of ``x``.
.. function:: log(x)
.. function:: log10(x)
.. function:: log2(x)
.. function:: modf(x)
.. function:: pow(x, y)
Returns ``x`` to the power of ``y``.
.. function:: radians(x)
.. function:: sin(x)
.. function:: sinh(x)
.. function:: sqrt(x)
Returns the square root of ``x``.
.. function:: tan(x)
.. function:: tanh(x)
.. function:: trunc(x)
Constants
---------
.. data:: e
base of the natural logarithm
.. data:: pi
the ratio of a circle's circumference to its diameter