diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-03 17:41:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-03 17:41:56 +0800 |
commit | 23b01e07a92ed92a40b3ee8dbdcf03174dc82db5 (patch) | |
tree | b6b2cafa2dcf23c64c6bfa8f2a1eff0947398a9f /meta/template/math.lua | |
parent | 7b76328600dd9bc5206f38a549da9e4f99c9ff84 (diff) | |
download | lua-language-server-23b01e07a92ed92a40b3ee8dbdcf03174dc82db5.zip |
add mark `---@nodiscard`
Diffstat (limited to 'meta/template/math.lua')
-rw-r--r-- | meta/template/math.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/template/math.lua b/meta/template/math.lua index e415bae6..67c76ff4 100644 --- a/meta/template/math.lua +++ b/meta/template/math.lua @@ -17,28 +17,33 @@ math = {} ---#DES 'math.abs' ---@param x number ---@return number +---@nodiscard function math.abs(x) end ---#DES 'math.acos' ---@param x number ---@return number +---@nodiscard function math.acos(x) end ---#DES 'math.asin' ---@param x number ---@return number +---@nodiscard function math.asin(x) end ---#if VERSION <= 5.2 then ---#DES 'math.atan<5.2' ---@param y number ---@return number +---@nodiscard function math.atan(y) end ---#else ---#DES 'math.atan>5.3' ---@param y number ---@param x? number ---@return number +---@nodiscard function math.atan(y, x) end ---#end @@ -47,42 +52,50 @@ function math.atan(y, x) end ---@param y number ---@param x number ---@return number +---@nodiscard function math.atan2(y, x) end ---#DES 'math.ceil' ---@param x number ---@return integer +---@nodiscard function math.ceil(x) end ---#DES 'math.cos' ---@param x number +---@nodiscard function math.cos(x) end ---@version <5.2 ---#DES 'math.cosh' ---@param x number ---@return number +---@nodiscard function math.cosh(x) end ---#DES 'math.deg' ---@param x number ---@return number +---@nodiscard function math.deg(x) end ---#DES 'math.exp' ---@param x number ---@return number +---@nodiscard function math.exp(x) end ---#DES 'math.floor' ---@param x number ---@return number +---@nodiscard function math.floor(x) end ---#DES 'math.fmod' ---@param x number ---@param y number ---@return number +---@nodiscard function math.fmod(x, y) end ---@version <5.2 @@ -90,6 +103,7 @@ function math.fmod(x, y) end ---@param x number ---@return number m ---@return number e +---@nodiscard function math.frexp(x) end ---@version <5.2 @@ -97,18 +111,21 @@ function math.frexp(x) end ---@param m number ---@param e number ---@return number +---@nodiscard function math.ldexp(m, e) end ---#if VERSION <= 5.1 and not JIT then ---#DES 'math.log<5.1' ---@param x number ---@return number +---@nodiscard function math.log(x) end ---#else ---#DES 'math.log>5.2' ---@param x number ---@param base? integer ---@return number +---@nodiscard function math.log(x, base) end ---#end @@ -116,24 +133,28 @@ function math.log(x, base) end ---#DES 'math.log10' ---@param x number ---@return number +---@nodiscard function math.log10(x) end ---#DES 'math.max' ---@param x number ---@vararg number ---@return number +---@nodiscard function math.max(x, ...) end ---#DES 'math.min' ---@param x number ---@vararg number ---@return number +---@nodiscard function math.min(x, ...) end ---#DES 'math.modf' ---@param x number ---@return integer ---@return number +---@nodiscard function math.modf(x) end ---@version <5.2 @@ -141,11 +162,13 @@ function math.modf(x) end ---@param x number ---@param y number ---@return number +---@nodiscard function math.pow(x, y) end ---#DES 'math.rad' ---@param x number ---@return number +---@nodiscard function math.rad(x) end ---#DES 'math.random' @@ -154,50 +177,59 @@ function math.rad(x) end ---@param m integer ---@param n integer ---@return integer +---@nodiscard function math.random(m, n) end ---#if VERSION >= 5.4 then ---#DES 'math.randomseed>5.4' ---@param x? integer ---@param y? integer +---@nodiscard function math.randomseed(x, y) end ---#else ---#DES 'math.randomseed<5.3' ---@param x integer +---@nodiscard function math.randomseed(x) end ---#end ---#DES 'math.sin' ---@param x number ---@return number +---@nodiscard function math.sin(x) end ---@version <5.2 ---#DES 'math.sinh' ---@param x number ---@return number +---@nodiscard function math.sinh(x) end ---#DES 'math.sqrt' ---@param x number ---@return number +---@nodiscard function math.sqrt(x) end ---#DES 'math.tan' ---@param x number ---@return number +---@nodiscard function math.tan(x) end ---@version <5.2 ---#DES 'math.tanh' ---@param x number ---@return number +---@nodiscard function math.tanh(x) end ---@version >5.3 ---#DES 'math.tointeger' ---@param x number ---@return integer? +---@nodiscard function math.tointeger(x) end ---#DES 'math.type' @@ -206,12 +238,14 @@ function math.tointeger(x) end ---| '"integer"' ---| '"float"' ---| 'nil' +---@nodiscard function math.type(x) end ---#DES 'math.ult' ---@param m integer ---@param n integer ---@return boolean +---@nodiscard function math.ult(m, n) end return math |