private static bool IsOutsideDoubleRange(BigDouble bigDouble) { if (BigDouble.IsNaN(bigDouble) || BigDouble.IsInfinity(bigDouble)) { return(false); } return(bigDouble.Exponent > Math.Log10(double.MaxValue) || bigDouble.Exponent < Math.Log10(double.Epsilon)); }
public static void AssertEqual(BigDouble bigDouble, double @double, double precision) { if (IsOutsideDoubleRange(bigDouble)) { Assert.Ignore("Result is not in range of possible Double values"); } if (BigDouble.IsNaN(bigDouble) && double.IsNaN(@double)) { return; } Assert.That(bigDouble.Equals(@double, precision), $"Double implementation: {@double}, BigDouble implementation {bigDouble}"); }