public void Sign(UnaryTestCase testCase) { if (double.IsNaN(testCase.Values.Double)) { // ReSharper disable once ReturnValueOfPureMethodIsNotUsed var doubleException = Assert.Catch(() => Math.Sign(testCase.Values.Double)); var bigDoubleException = Assert.Catch(() => BigDouble.Sign(testCase.Values.BigDouble)); Assert.That(doubleException.GetType(), Is.EqualTo(bigDoubleException.GetType())); return; } testCase.AssertEqual(d => Math.Sign(d), d => BigDouble.Sign(d)); }
public void Negate(UnaryTestCase testCase) { testCase.AssertEqual(d => - d, bd => - bd); }
public void Truncate(UnaryTestCase testCase) { testCase.AssertEqual(Math.Truncate, BigDouble.Truncate); }
public void Tanh(UnaryTestCase testCase) { // TODO: Check if indeed bad precision or bug testCase.AssertEqual(Math.Tanh, BigDouble.Tanh, 1E-13); }
public void Round(UnaryTestCase testCase) { testCase.AssertEqual(Math.Round, BigDouble.Round); }
public void Log10(UnaryTestCase testCase) { testCase.AssertEqual(Math.Log10, d => BigDouble.Log10(d)); }
public void Floor(UnaryTestCase testCase) { testCase.AssertEqual(Math.Floor, BigDouble.Floor); }
public void Ceiling(UnaryTestCase testCase) { testCase.AssertEqual(Math.Ceiling, BigDouble.Ceiling); }
public void Abs(UnaryTestCase testCase) { testCase.AssertEqual(Math.Abs, BigDouble.Abs); }