From 4e52738f7a315085505ffdbefe9ce6722ec3965f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 12 Nov 2020 21:16:48 +0800 Subject: =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meta/template/math.lua | 149 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 meta/template/math.lua (limited to 'meta/template/math.lua') diff --git a/meta/template/math.lua b/meta/template/math.lua new file mode 100644 index 00000000..31473b25 --- /dev/null +++ b/meta/template/math.lua @@ -0,0 +1,149 @@ +---@class math +---@field huge number +---@field maxinteger integer +---@field mininteger integer +---@field pi number +math = {} + +---@param x number +---@return number +function math.abs(x) end + +---@param x number +---@return number +function math.acos(x) end + +---@param x number +---@return number +function math.asin(x) end + +---@param y number +---@param x number +---@return number +function math.atan(y, x) end + +---@param y number +---@param x number +---@return number + +---@param y any +---@param x any +function math.atan2(y, x) end + +---@param x number +---@return integer +function math.ceil(x) end + +---@param x number +function math.cos(x) end + +---@param x number +---@return number +function math.cosh(x) end + +---@param x number +---@return number +function math.deg(x) end + +---@param x number +---@return number +function math.exp(x) end + +---@param x number +---@return number +function math.floor(x) end + +---@param x number +---@param y number +---@return number +function math.fmod(x, y) end + +---@param x number +---@return number m +---@return number e +function math.frexp(x) end + +---@param m number +---@param e number +---@return number +function math.ldexp(m, e) end + +---@param x number +---@param base integer? +---@return number +function math.log(x, base) end + +---@param x number +---@return number +function math.log10(x) end + +---@param x number +---@vararg number +---@return number +function math.max(x, ...) end + +---@param x number +---@vararg number +---@return number +function math.min(x, ...) end + +---@param x number +---@return integer +---@return number +function math.modf(x) end + +---@param x number +---@param y number +---@return number +function math.pow(x, y) end + +---@param x number +---@return number +function math.rad(x) end + +---@overload fun():number +---@overload fun(m: integer):integer +---@param m integer +---@param n integer +---@return integer +function math.random(m, n) end + +---@param x integer? +---@param y integer? +function math.randomseed(x, y) end + +---@param x number +---@return number +function math.sin(x) end + +---@param x number +---@return number +function math.sinh(x) end + +---@param x number +---@return number +function math.sqrt(x) end + +---@param x number +---@return number +function math.tan(x) end + +---@param x number +---@return number +function math.tanh(x) end + +---@param x number +---@return integer? +function math.tointeger(x) end + +---@param x any +---@return +---| '"integer"' +---| '"float"' +---| 'nil' +function math.type(x) end + +---@param m integer +---@param n integer +---@return boolean +function math.ult(m, n) end -- cgit v1.2.3