--Module to calculate basic math valuesmathematics =
mathematics.addition = function(input) --Addition function local sum = 0 --Define variable for use in loop for i, arg in pairs(input.args) do --Loop to run through all arguments sum = sum + arg --Add argument value to sum end return sum --Output the sum to the moduleend
mathematics.subtraction = function(input) --Subtraction function local dif = input.args[1] - input.args[2] --Subtract second argument from first return dif --Outpud difference to moduleend
mathematics.multiplication = function(input) --Multiplication function local product = 1 --Set product as 1 (so multiplication of it works) local pi = 3.141592653589793 --Set pi as 15 digits of precision for i, arg in pairs(input.args) do --Allow multiple arguments if (arg
"π" or arg
mathematics.division = function(input) --Division function local quotient = input.args[1] / input.args[2] --Divide arg1 by arg2 return quotient --Output quotient to moduleend
return mathematics --Output module to place of use