math¶
math
provides some mathematics functions.Properties¶
number math.pi¶
The constant value of pi.
number math.huge¶
The value equal to or larger than any other numerical value.
Functions¶
number math.abs(number x)¶
ReturnsA number.
Returns the absolute value of x
.
x
A number.
number math.acos(number x)¶
ReturnsA number.
The function acos.
x
The argument in radians.
number math.asin(number x)¶
ReturnsA number.
The function asin.
x
The argument in radians.
number math.atan(number x)¶
ReturnsA number.
The function atan.
x
The argument in radians.
number math.atan2(number y, number x)¶
ReturnsA number.
Returns the arc tangent of y/x (in radians).
y
A number.x
A number.
number math.cos(number x)¶
ReturnsA number.
The function cos.
x
The argument in radians.
number math.cosh(number x)¶
ReturnsA number.
The hyperbolic cosine function.
x
A number.
number math.sin(number x)¶
ReturnsA number.
The function sin.
x
The argument in radians.
number math.sinh(number x)¶
ReturnsA number.
The hyperbolic sine function.
x
A number.
number math.tan(number x)¶
ReturnsA number.
The function tan.
x
The argument in radians.
number math.tanh(number x)¶
ReturnsA number.
The hyperbolic tangent function.
x
A number.
number math.deg(number x)¶
ReturnsThe angle in degrees.
Returns the angle x (given in radians) in degrees.
x
The angle in radians.
number math.rad(number x)¶
ReturnsThe angle in radians.
Returns the angle x (given in degrees) in radians.
x
The angle in degrees.
number math.ceil(number x)¶
ReturnsA number.
Returns the smallest integer equal to or larger than x
.
x
A number.
number math.floor(number x)¶
ReturnsA number.
Returns the largest integer equal to or smaller than x
.
x
A number.
number math.max(... xs)¶
ReturnsThe maximum number.
Returns the maximum value among its arguments.
xs
Some numbers.
number math.min(... xs)¶
ReturnsThe minimum number.
Returns the minimum value among its arguments.
xs
Some numbers.
number math.exp(number x)¶
ReturnsThe result.
Returns the value of e^x.
x
The exponent number.
number math.log(number x)¶
ReturnsThe result.
Returns the natural logarithm of x.
x
A number.
number math.log10(number x)¶
ReturnsThe result.
Returns the base-10 logarithm of x.
x
A number.
number math.pow(number x, number y)¶
ReturnsThe result.
Returns x^y.
x
The base part.y
The exponent part.
number math.sqrt(number x)¶
ReturnsThe result.
Returns the square root of x.
x
A number.