Roots of unity: Difference between revisions

m
m (→‎{{header|Lua}}: whitespace)
Line 452:
Complex numbers from the Lua implementation on the complex numbers page.
 
<lang lua>--defines addition, subtraction, negation, multiplication, division, conjugation, norms, and a conversion to strgs.
<lang lua>
--defines addition, subtraction, negation, multiplication, division, conjugation, norms, and a conversion to strgs.
complex = setmetatable({
__add = function(u, v) return complex(u.real + v.real, u.imag + v.imag) end,
Line 481 ⟶ 480:
root = root * val
print(root .. "")
end</lang>
</lang>
 
=={{header|Mathematica}}==
Anonymous user