# Why is sage giving me wrong answers?

Let's say I want to multiply $(\frac{-1 - i \sqrt{3}}{2})(\frac{-1 + i \sqrt{3}}{2})$. Doing it by hand, we easily see that the answer is 1.

However, when I type

n(((-1 + sqrt(-3))/2)*((-1-sqrt(-3))/2))

in sage, I get

1 - 5.55111512312578 x 10^(-17)i

which is (of course) very close to 1...but its not exactly 1. Why is that? How do I fix this??

Note that if you use a slightly different expression (with simply remove parentheses), you get the correct answer. In the following example, I just removed the (useless) parentheses around the fractions, and you get the same answer if you replace the two divisions by $2$ by a division by $4$.