Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local api = {}
- function api.min(first, ...)
- local min = first
- for i, v in ipairs({ ... }) do
- if v < min then
- min = v
- end
- end
- return min
- end
- function api.max(first, ...)
- local max = first
- for i, v in ipairs({ ... }) do
- if v > max then
- max = v
- end
- end
- return max
- end
- function api.minMax(first, ...)
- local min = first
- local max = first
- for i, v in ipairs({ ... }) do
- if v > max then
- max = v
- end
- if v < min then
- min = v
- end
- end
- return {min, max}
- end
- function api.abs(v)
- if v < 0 then
- return -v
- end
- return v
- end
- function api.floor(v)
- return math.floor(v)
- end
- function api.sqrt(v)
- return math.sqrt(v)
- end
- return {
- name = 'math',
- api = api
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement