New Maix series products MaixCAM online now, and new MaixPy,feature richer functionalities, enhanced performance, and user-friendly software, with comprehensive documentationx

math-mathematical functions

This module implements a subset of the corresponding CPython module, as described below. For more information, please refer to the original CPython documentation: math.

The math module provides some basic mathematical functions for handling floating point numbers.

1. Function#

1.1. math.acos(x)#

Returns the arc cosine of x.

1.2. math.acosh(x)#

Returns the inverse hyperbolic cosine of x.

1.3. math.asin(x)#

Returns the arc sine of x.

1.4. math.asinh(x)#

Returns the inverse hyperbolic sine of x.

1.5. math.atan(x)#

Returns the arc tangent of x.

1.6. math.atan2(y, x)#

Returns the principal value of the arctangent of y /x.

1.7. math.atanh(x)#

Returns the inverse hyperbolic tangent of x.

1.8. math.ceil(x)#

Returns an integer, "x" is rounded to positive infinity.

1.9. math.copysign(x, y)#

Return x with the sign of y.

1.10. math.cos(x)#

Returns the cosine of x.

1.11. math.cosh(x)#

Returns the hyperbolic cosine of x

1.12. math.degrees(x)#

Returns the radians x converted to degrees.

1.13. math.erf(x)#

Error function that returns x.

1.14. math.erfc(x)#

Returns the complementary error function of x.

1.15. math.exp(x)#

Returns the exponent of x.

1.16. math.expm1(x)#

Return exp(x)-1.

1.17. math.fabs(x)#

Returns the absolute value of x.

1.18. math.floor(x)#

Returns an integer, "x" is rounded towards negative infinity.

1.19. math.fmod(x, y)#

Returns the remainder of x /y.

1.20. math.frexp(x)#

Decompose floating point numbers into mantissa and exponent. The returned value is the tuple (m, e), so that x == m * 2 ** e is completely correct. If x == 0, the function returns (0.0,0), otherwise the relationship 0.5 <= abs(m)<1 holds.

1.21. math.gamma(x)#

Returns the gamma function of x.

1.22. math.isfinite(x)#

If x is finite, it returns True.

1.23. math.isinf(x)#

If x is infinite, it returns True.

1.24. math.isnan(x)#

If x is not a number, it returns True

1.25. math.ldexp(x, exp)#

Return x *(2 ** exp).

1.26. math.lgamma(x)#

Returns the natural logarithm of the gamma function of x.

1.27. math.log(x)#

Returns the natural logarithm of x.

1.28. math.log10(x)#

Returns the base 10 logarithm of x.

1.29. math.log2(x)#

Returns the base-2 logarithm of x.

1.30. math.modf(x)#

Returns a tuple of two floating-point numbers, the fraction and integer part of "x". Both return values ​​have the same sign as x.

1.31. math.pow(x, y)#

Return x to the power of'y`.

1.32. math.radians(x)#

Returns the degree x converted to radians.

1.33. math.sin(x)#

Returns the sine of x.

1.34. math.sinh(x)#

Returns the hyperbolic sine of x.

1.35. math.sqrt(x)#

Returns the square root of x.

1.36. math.tan(x)#

Returns the tangent of x.

1.37. math.tanh(x)#

Returns the hyperbolic tangent of x.

1.38. math.trunc(x)#

Returns an integer, "x" is rounded towards 0.

2. Constants#

2.1. math.e#

The basis of natural logarithm

2.2. math.pi#

Ratio of circumference to diameter

Related Issues not found

Please login GitHub to create issue