--------------------------------------------------------------------------------
table.maxn (table)
Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices. (To do its job this function does a linear traversal of the whole table.)
--------------------------------------------------------------------------------
table.remove (table [, pos])
Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed element. The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.
--------------------------------------------------------------------------------
table.sort (table [, comp])
Sorts table elements in a given order, in-place, from table[1] to table[n], where n is the length of the table. If comp is given, then it must be a function that receives two table elements, and returns true when the first is less than the second (so that not comp(a[i+1],a[i]) will be true after the sort). If comp is not given, then the standard Lua operator < is used instead.
The sort algorithm is not stable; that is, elements considered equal by the given order may have their relative positions changed by the sort.
5.6 - Mathematical Functions
This library is an interface to the standard C math library. It provides all its functions inside the table math.
--------------------------------------------------------------------------------
math.abs (x)
Returns the absolute value of x.
--------------------------------------------------------------------------------
math.acos (x)
Returns the arc cosine of x (in radians).
--------------------------------------------------------------------------------
math.asin (x)
Returns the arc sine of x (in radians).
--------------------------------------------------------------------------------
math.atan (x)
Returns the arc tangent of x (in radians).
--------------------------------------------------------------------------------
math.atan2 (y, x)
Returns the arc tangent of y/x (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of x being zero.)
--------------------------------------------------------------------------------
math.ceil (x)
Returns the smallest integer larger than or equal to x.
--------------------------------------------------------------------------------
math.cos (x)
Returns the cosine of x (assumed to be in radians).
--------------------------------------------------------------------------------
math.cosh (x)
Returns the hyperbolic cosine of x.
5. Standard libraries
Zacznij od początku
