Ejemplo n.º 1
0
 public void TestArcSin()
 {
     for (Double x = -1.0; x <= 1.0; x += 0.01)
     {
         Double  rad      = x * DoublePrecision.Maths.Deg2Rad;
         Fixed64 f        = rad;
         Fixed64 fs       = Fixed64.ArcSin(f);
         Double  result   = fs.ToDouble();
         Double  expected = Math.Asin(rad);
         Assert.That(result,
                     Is.EqualTo(expected).Within(MathsTests.TestTolerance).                           // Check that result is within test tolerance for Fixed64
                     Or.EqualTo(expected).Within(MathsTests.PercentageTolerance * Math.Abs(result))); // or that result is within test percentage for Fixed64.
     }
 }