示例#1
0
 public void TestArcTan()
 {
     for (Double x = -18.0; x <= 18.0; x += 0.01)
     {
         Fixed32 f        = x;
         Fixed32 fs       = Fixed32.ArcTan(f);
         Double  result   = fs.ToDouble();
         Double  expected = Math.Atan(x);
         Assert.That(result,
                     Is.EqualTo(expected).Within(MathsTests.TestTolerance).                           // Check that result is within test tolerance for Fixed32
                     Or.EqualTo(expected).Within(MathsTests.PercentageTolerance * Math.Abs(result))); // or that result is within test percentage for Fixed32.
     }
 }