=head1 NAME math - mathematical functions (standard library) =head1 OVERVIEW This library is an interface to the standard C math library. It provides all its functions inside the table C. =head1 REFERENCE =head2 C math.abs (x) Returns the absolute value of C. =head2 C math.acos (x) Returns the arc cosine of C (in radians). =head2 C math.asin (x) Returns the arc sine of C (in radians). =head2 C math.atan (x) Returns the arc tangent of C (in radians). =head2 C math.atan2 (x, y) Returns the arc tangent of C (in radians), but uses the signs of both parameters to find the quadrant of the result. (It also handles correctly the case of C being zero.) =head2 C math.ceil (x) Returns the smallest integer larger than or equal to C. =head2 C math.cos (x) Returns the cosine of C (assumed to be in radians). =head2 C math.cosh (x) Returns the hyperbolic cosine of C. =head2 C math.deg (x) Returns the angle C (given in radians) in degrees. =head2 C math.exp (x) Returns the the value C. =head2 C math.floor (x) Returns the largest integer smaller than or equal to C. =head2 C math.fmod (x, y) Returns the remainder of the division of C by C. =head2 C math.frexp (x) Returns C and C such that x = m2^e, C is an integer and the absolute value of C is in the range C<[0.5, 1)> (or zero when C is zero). =head2 C math.huge The value C, a value larger than or equal to any other numerical value. =head2 C math.ldexp (m, e) Returns C (C should be an integer). =head2 C math.log (x) Returns the natural logarithm of C. math.log10 (x) Returns the base-10 logarithm of C. =head2 C math.max (x, ...) Returns the maximum value among its arguments. =head2 C math.min (x, ...) Returns the minimum value among its arguments. =head2 C math.modf (x) Returns two numbers, the integral part of C and the fractional part of C. =head2 C math.pi The value PI. =head2 C math.pow (x, y) Returns C. (You can also use the expression C to compute this value.) =head2 C math.rad (x) Returns the angle C (given in degrees) in radians. =head2 C math.random ([m [, n]]) This function is an interface to the simple pseudo-random generator function C provided by ANSI C. (No guarantees can be given for its statistical properties.) When called without arguments, returns a pseudo-random real number in the range [0,1). When called with a number C, C returns a pseudo-random integer in the range [1, m]. When called with two numbers C and C, C returns a pseudo-random integer in the range [m, n]. =head2 C math.randomseed (x) Sets C as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers. =head2 C math.sin (x) Returns the sine of C (assumed to be in radians). =head2 C math.sinh (x) Returns the hyperbolic sine of C. =head2 C math.sqrt (x) Returns the square root of C. (You can also use the expression C to compute this value.) =head2 C math.tan (x) Returns the tangent of C (assumed to be in radians). =head2 C math.tanh (x) Returns the hyperbolic tangent of C. =head1 VERSION This is Lua version 5.1.1. =head1 CREDITS Lua is developed at Lua.org, a laboratory of the Department of Computer Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro in Brazil). For more information about the authors, see http://www.lua.org/authors.html . =head1 LICENSE Lua is licensed under the terms of the MIT license reproduced below. This means that Lua is free software and can be used for both academic and commercial purposes at absolutely no cost. For details and rationale, see http://www.lua.org/license.html . ~~~~~ Copyright (C) 1994-2006 Lua.org, PUC-Rio. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ~~~~~