Home Explore Blog CI



neovim

67th chunk of `runtime/doc/luaref.txt`
13967b46cc075a31a7df4d8abe56ba2e8fda63a40b1536f70000000100000fa2
                                            *math.asin()*
        Returns the arc sine of {x} (in radians).

math.atan({x})                                                     *math.atan()*
        Returns the arc tangent of {x} (in radians).

math.atan2({x}, {y})                                              *math.atan2()*
        Returns the arc tangent of `x/y` (in radians), but uses the signs of
        both parameters to find the quadrant of the result. (It also handles
        correctly the case of {y} being zero.)

math.ceil({x})                                                     *math.ceil()*
        Returns the smallest integer larger than or equal to {x}.

math.cos({x})                                                       *math.cos()*
        Returns the cosine of {x} (assumed to be in radians).

math.cosh({x})                                                     *math.cosh()*
        Returns the hyperbolic cosine of {x}.

math.deg({x})                                                       *math.deg()*
        Returns the angle {x} (given in radians) in degrees.

math.exp({x})                                                       *math.exp()*
        Returns the value `e^x`.

math.floor({x})                                                   *math.floor()*
        Returns the largest integer smaller than or equal to {x}.

math.fmod({x}, {y})                                                *math.fmod()*
        Returns the remainder of the division of {x} by {y}.

math.frexp({x})                                                   *math.frexp()*
        Returns `m` and `e` such that `x = m * 2^e`, `e` is an integer and the
        absolute value of `m` is in the range `[0.5, 1)` (or zero when {x} is
        zero).

math.huge                                                            *math.huge*
        The value `HUGE_VAL`, a value larger than or equal to any other
        numerical value.

math.ldexp({m}, {e})                                              *math.ldexp()*
        Returns `m * 2^e` (`e` should be an integer).

math.log({x})                                                       *math.log()*
        Returns the natural logarithm of {x}.

math.log10({x})                                                   *math.log10()*
        Returns the base-10 logarithm of {x}.

math.max({x}, {...})                                                *math.max()*
        Returns the maximum value among its arguments.

math.min({x}, {...})                                                *math.min()*
        Returns the minimum value among its arguments.

math.modf({x})                                                     *math.modf()*
        Returns two numbers, the integral part of {x} and the fractional part
        of {x}.

math.pi                                                                *math.pi*
        The value of `pi`.

math.pow({x}, {y})                                                  *math.pow()*
        Returns `x^y`. (You can also use the expression `x^y` to compute this
        value.)

math.rad({x})                                                       *math.rad()*
        Returns the angle {x} (given in degrees) in radians.

math.random([{m} [, {n}]])                                       *math.random()*
        This function is an interface to the simple pseudo-random generator
        function `rand` 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 {m}, `math.random`
        returns a pseudo-random integer in the range `[1, m]`. When called
        with two numbers {m} and {n}, `math.random` returns a pseudo-random
        integer in the range `[m, n]`.

math.randomseed({x})                                         *math.randomseed()*
        Sets {x} as the "seed" for the pseudo-random generator: equal seeds
        produce equal sequences of

Title: Lua Math Library: Trigonometric, Logarithmic, and Utility Functions
Summary
This section of the Lua documentation details various mathematical functions available in the `math` library. It includes trigonometric functions such as `math.asin`, `math.atan`, and `math.atan2`, as well as `math.ceil`, `math.cos`, `math.cosh`, `math.deg`, `math.exp`, `math.floor`, `math.fmod`, `math.frexp`, `math.ldexp`, `math.log`, `math.log10`, `math.max`, `math.min`, `math.modf`, `math.pow`, `math.rad`, `math.random`, and `math.randomseed`. It also defines `math.huge` and `math.pi`.