Project: Complex Number Class
[[Complex_number|Complex numbers]] is a number that can be expressed in the form `a + bi` where `a` and `b` are real numbers and `i` represents the imaginary quantity `sqrt(-1)`. Define a complex number class that can perform multiplication, division, reciprocal, addition, subtraction, absolute value (magnitude), argument (phase), square root, exponential, and natural logarithm functions.
Output
$ perl ComplexNumberClass.pl
a: 1+1i
b: 3+4i
a + b: 4+5i
a - b: -2-3i
a * b: -1+7i
1 / a: 0.5-0.5i
1 / b: 0.12-0.16i
a / b: 0.28-0.04i
|a|: 1.4142135623731
|b|: 5
φ(a): 0.785398163397448
φ(b): 0.927295218001612
sqrt(a): 1.09868411346781+0.455089860562227i
sqrt(b): 2+1i
exp(a): 1.46869393991589+2.28735528717884i
exp(b): -13.1287830814622-15.200784463068i
ln(a): 0.346573590279973+0.785398163397448i
ln(b): 1.6094379124341+0.927295218001612i