3,314
回編集
細編集の要約なし |
編集の要約なし |
||
57行目: | 57行目: | ||
for i = firstk, lastk do | for i = firstk, lastk do | ||
output = output + k2*i*i + k1*i + k0 | output = output + k2*i*i + k1*i + k0 | ||
end | |||
return output | |||
end | |||
function p.captalPi(frame) -- the product of ([1] * k^2) + ([2] * k^1) + ([3] * k^0) as k goes from [4] to [5] | |||
local k2, k1, k0 = tonumber(frame.args[1]), tonumber(frame.args[2]), tonumber(frame.args[3]) | |||
local firstk, lastk = tonumber(frame.args[4]), tonumber(frame.args[5]) | |||
output = 1 | |||
for i = firstk, lastk do | |||
output = output * (k2*i*i + k1*i + k0) | |||
end | end | ||
return output | return output |
回編集