public void TestAdd() { double One16th = Math.Pow(2, -4); double One256th = Math.Pow(2, -8); double One1024th = Math.Pow(2, -10); double t = 4; t += 3 * One16th; t += 2 * One256th; t += One1024th; Fp a = new Fp(t); a.ReportDigitsBin(); double t2 = 2; t2 += 2 * One16th; t2 += One256th; t2 += One1024th; Fp b = new Fp(t2); b.ReportDigitsBin(); Fp p = Fp.Add(a, b); p.ReportDigitsBin(); }
public void AddTest() { BigInt e = new BigInt("99a66d3865656bdbf486b581cd8233e3c", 16); Assert.AreEqual(e, field.Add(a, b)); }