Solution (source code)

= Solution

The <residue> is the coefficient of $(z-a)^{-1}$ in the <Laurent series>:
$$
\boxed{\operatorname{res}(f,a)=c_{-1}}.
$$
Equivalently it is $\tfrac1{2\pi i}\int_{|z-a|=r}f(z)\,dz$ for a positively oriented circle small enough to enclose no other singularities.