The integral given is
$$\int_{-\infty}^{\infty} \frac{\cos(x)-1}{x^2}\,dx $$
Ok, so, I've used the upper semi circular contour with the function
$$f(z) = \frac{e^{iz}-1}{z^2}$$
Now the residue I get is $i$ which when used with the residue theorem gives me the answer of $-2\pi$ as the answer to the integral of the $f(z)$ and through this I get my answer to the original integral as $-2\pi$. However in the answers to this question the answer states that the solution is $-\pi$. I've double checked with Wolfram Alpha and Wolfram Alpha also gives this as an answer. Can anyone please correct me where I'm going wrong? Thanks.