Solution (source code)

= Solution

The number $ie^{i\phi}$ has <modulus> one and <argument> $\phi+\pi/2$ modulo $2\pi$. Therefore its <complex logarithm> has values
$$
\boxed{\ln(ie^{i\phi})=i(\phi+\pi/2+2\pi k),\quad k\in\mathbb Z.}
$$
Every value has <real part> zero. For the <principal complex logarithm>, choose the unique integer giving imaginary part in $(-\pi,\pi]$. The unwrapped value $\phi+\pi/2$ is the principal imaginary part only when it already lies in that interval.