I was astounded to find that the System.Numerics.Complex
data type in .NET doesn't yield mathematically accurate results.
Complex.Sqrt(-1) != Complex.ImaginaryOne
Instead of (0, 1), I get (6.12303176911189E-17, 1), which looks a lot like a rounding error.
Now I realize that floating point arithmetic will lead to results like this sometimes, but usually using integers will avoid rounding errors.
Why does this seemingly basic operation yield an obviously wrong result?