public void TestMethodCos() { for (int i = 0; i < testCount; i++) { double d = Random.NextDouble(); decimal d1 = (decimal)d; d = Math.Cos(d); d1 = DecimalMath.Cos(d1); Debug.Assert(DecimalMath.Abs((decimal)d - d1) < epsilon); } }
public void TestMethodAtan2() { for (int i = 0; i < testCount; i++) { double x = Random.NextDouble(); double y = Random.NextDouble(); decimal dx = (decimal)x; decimal dy = (decimal)y; var d = Math.Atan2(y, x); var z = DecimalMath.Atan2(dy, dx); Debug.Assert(DecimalMath.Abs((decimal)d - z) < epsilon); } }
public void TestMethodExp() { for (int i = 0; i < testCount; i++) { double d = Random.NextDouble(); decimal d1 = (decimal)d; d = Math.Exp(d); d1 = DecimalMath.Exp(d1); Debug.WriteLine("d=" + d); Debug.WriteLine("d1=" + d1); Debug.Assert(DecimalMath.Abs((decimal)d - d1) < epsilon); } }