Does anybody know how I could make a function to get the LCM of 2 numbers (or more)? I’ve started but I’m a little bit stuck.
Here’s what I have so far:
local function GCF(n1, n2)
local gcd = 1
if n1 > n2 then
n1 = n1 + n2
n2 = n1 - n2
n1 = n1 - n2
elseif (n2 == math.round(n2 / n1)) * n1 then
gcd = n1
else
for i = math.round(n1 / 2)
end
end
local function LCM(n1, n2)
end