Пример #1
0
 public void IntIsCongruentToPowerOf2()
 {
     using (var a = new HugeInt("234052834524092854092874502983745029345723098457209305983434345"))
     using (var c = new HugeInt("293847502987609283945873594873409587"))
     {
         uint b = 120;
         a.Value = (a << b) + c;
         Assert.IsTrue(a.IsCongruentToModPowerOf2(c, b));
         Assert.IsFalse(a.IsCongruentToModPowerOf2(c, b + 3));
         c.Value = c + 1;
         Assert.IsFalse(a.IsCongruentToModPowerOf2(c, b));
     }
 }