Clamping is where you want to restrict a value from going too high or too low
local arit = require('arithmetic')
print( arit.clamp(67 , 1 , 50) ) -- Returns 50Mean is the average number in a group
local arit = require("arithmetic")
local foo = {23,21,34,9,10,8,27,16}
print( arit.mean( ok ) ) -- Returns 18.5Range is the difference between the lowest and highest value in a group
local arit = require("arithmetic")
local foo = {24,54,12,87,34,99,32,55}
print( arit.range( foo ) ) -- Returns 87Factorial is the product of a integer and all integers below it
local arit = require("arithmetic")
print( arit.factor(4) ) -- Returns 24Mode is the value that appears most in a array
Always use unpack() to get the mode data
local arit = require("arithmetic")
local foo = {1,1,1,2,2,3,3,3,3,4,5,5,5,5,5}
print( unpack(arit.mode( foo )) ) -- Returns 5