PUSH [===[---@meta math

]===]
DES 'math'
PUSH [===[
---@class mathlib
]===]
DES 'math.huge'
PUSH [===[
---@field huge       number
]===]
if VERSION >= 5.3 then
PUSH [===[
]===]
DES 'math.maxinteger'
PUSH [===[
---@field maxinteger integer
]===]
DES 'math.mininteger'
PUSH [===[
---@field mininteger integer
]===]
end
PUSH [===[
]===]
DES 'math.pi'
PUSH [===[
---@field pi         number
math = {}

]===]
DES 'math.abs'
PUSH [===[
---@generic Number: number
---@param x Number
---@return Number
---@nodiscard
function math.abs(x) end

]===]
DES 'math.acos'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.acos(x) end

]===]
DES 'math.asin'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.asin(x) end

]===]
if VERSION <= 5.2 then
PUSH [===[
]===]
DES 'math.atan<5.2'
PUSH [===[
---@param y number
---@return number
---@nodiscard
function math.atan(y) end
]===]
else
PUSH [===[
]===]
DES 'math.atan>5.3'
PUSH [===[
---@param y  number
---@param x? number
---@return number
---@nodiscard
function math.atan(y, x) end
]===]
end
PUSH [===[

---@version <5.2
]===]
DES 'math.atan2'
PUSH [===[
---@param y number
---@param x number
---@return number
---@nodiscard
function math.atan2(y, x) end

]===]
DES 'math.ceil'
PUSH [===[
---@param x number
---@return integer
---@nodiscard
function math.ceil(x) end

]===]
DES 'math.cos'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.cos(x) end

---@version <5.2
]===]
DES 'math.cosh'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.cosh(x) end

]===]
DES 'math.deg'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.deg(x) end

]===]
DES 'math.exp'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.exp(x) end

]===]
DES 'math.floor'
PUSH [===[
---@param x number
---@return integer
---@nodiscard
function math.floor(x) end

]===]
DES 'math.fmod'
PUSH [===[
---@param x number
---@param y number
---@return number
---@nodiscard
function math.fmod(x, y) end

---@version <5.2, >5.5
]===]
DES 'math.frexp'
PUSH [===[
---@param x number
---@return number m
---@return number e
---@nodiscard
function math.frexp(x) end

---@version <5.2, >5.5
]===]
DES 'math.ldexp'
PUSH [===[
---@param m number
---@param e number
---@return number
---@nodiscard
function math.ldexp(m, e) end

]===]
if VERSION <= 5.1 and not JIT then
PUSH [===[
]===]
DES 'math.log<5.1'
PUSH [===[
---@param x     number
---@return number
---@nodiscard
function math.log(x) end
]===]
else
PUSH [===[
]===]
DES 'math.log>5.2'
PUSH [===[
---@param x     number
---@param base? integer
---@return number
---@nodiscard
function math.log(x, base) end
]===]
end
PUSH [===[

---@version <5.1
]===]
DES 'math.log10'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.log10(x) end

]===]
DES 'math.max'
PUSH [===[
---@generic Number: number
---@param x Number
---@param ... Number
---@return Number
---@nodiscard
function math.max(x, ...) end

]===]
DES 'math.min'
PUSH [===[
---@generic Number: number
---@param x Number
---@param ... Number
---@return Number
---@nodiscard
function math.min(x, ...) end

]===]
DES 'math.modf'
PUSH [===[
---@param x number
---@return integer
---@return number
---@nodiscard
function math.modf(x) end

---@version <5.2
]===]
DES 'math.pow'
PUSH [===[
---@param x number
---@param y number
---@return number
---@nodiscard
function math.pow(x, y) end

]===]
DES 'math.rad'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.rad(x) end

]===]
DES 'math.random'
PUSH [===[
---@overload fun():number
---@overload fun(m: integer):integer
---@param m integer
---@param n integer
---@return integer
---@nodiscard
function math.random(m, n) end

]===]
if VERSION >= 5.4 then
PUSH [===[
]===]
DES 'math.randomseed>5.4'
PUSH [===[
---@param x? integer
---@param y? integer
function math.randomseed(x, y) end
]===]
else
PUSH [===[
]===]
DES 'math.randomseed<5.3'
PUSH [===[
---@param x integer
function math.randomseed(x) end
]===]
end
PUSH [===[

]===]
DES 'math.sin'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.sin(x) end

---@version <5.2
]===]
DES 'math.sinh'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.sinh(x) end

]===]
DES 'math.sqrt'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.sqrt(x) end

]===]
DES 'math.tan'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.tan(x) end

---@version <5.2
]===]
DES 'math.tanh'
PUSH [===[
---@param x number
---@return number
---@nodiscard
function math.tanh(x) end

---@version >5.3
]===]
DES 'math.tointeger'
PUSH [===[
---@param x any
---@return integer?
---@nodiscard
function math.tointeger(x) end

---@version >5.3
]===]
DES 'math.type'
PUSH [===[
---@param x any
---@return
---| '"integer"'
---| '"float"'
---| 'nil'
---@nodiscard
function math.type(x) end

---@version >5.3
]===]
DES 'math.ult'
PUSH [===[
---@param m integer
---@param n integer
---@return boolean
---@nodiscard
function math.ult(m, n) end

return math
]===]