Arithmetic/Complex: Difference between revisions
Content added Content deleted
Line 987: | Line 987: | ||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
<lang lua> |
|||
--defines addition, subtraction, negation, multiplication, division, conjugation, norms, and a conversion to strings. |
--defines addition, subtraction, negation, multiplication, division, conjugation, norms, and a conversion to strings. |
||
complex = setmetatable({ |
complex = setmetatable({ |
||
Line 1,016: | Line 1,016: | ||
print("|" .. i.string .. "| = " .. math.sqrt(i.norm)) |
print("|" .. i.string .. "| = " .. math.sqrt(i.norm)) |
||
print(i.string .. "* = " .. i.conj.string) |
print(i.string .. "* = " .. i.conj.string) |
||
</lang> |
|||
=={{header|Maple}}== |
=={{header|Maple}}== |