public void TestSqrt() { var z = new Complex(1.961570561, 0.3901806440); var w = ComplexArithmetic.Sqrt(z); Assert.IsTrue(z.ApproximatelyEquals(w * w, Epsilon)); z = new Complex(-1.961570561, 0.3901806440); w = ComplexArithmetic.Sqrt(z); Assert.IsTrue(z.ApproximatelyEquals(w * w, Epsilon)); z = new Complex(-1.961570561, -0.3901806440); w = ComplexArithmetic.Sqrt(z); Assert.IsTrue(z.ApproximatelyEquals(w * w, Epsilon)); z = new Complex(1.961570561, -0.3901806440); w = ComplexArithmetic.Sqrt(z); Assert.IsTrue(z.ApproximatelyEquals(w * w, Epsilon)); }