public void AddLongTest() { foreach (MultiPrecision <Pow2.N8> a in vs) { foreach (long b in us) { MultiPrecision <Pow2.N8> c_actual = MultiPrecision <Pow2.N8> .Add(a, b); MultiPrecision <Pow2.N8> c_expect = MultiPrecision <Pow2.N8> .Add(a, (MultiPrecision <Pow2.N8>) b); Trace.WriteLine($"{a} + {b} = {c_expect}"); Trace.WriteLine($"{a} + {b} = {c_actual}"); if (c_actual.IsNaN && c_expect.IsNaN) { continue; } if (a.IsNaN) { if (!c_actual.IsNaN) { Console.WriteLine($"{a} + {b} = {c_expect}"); Console.WriteLine($"{a} + {b} = {c_actual}"); Console.Write("\n"); Assert.Fail(); } } else { Console.WriteLine($"{a} + {b} = {c_expect}"); Console.WriteLine($"{a} + {b} = {c_actual}"); Console.Write("\n"); Assert.AreEqual(c_expect, c_actual); } } } }