summaryrefslogtreecommitdiff
path: root/meta/template/math.lua
blob: 11dc6e9ab08df1fd22c046b738aa8093b18237b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
---@meta

---@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

return math