Example #1
0
 public void NearestCoprimeCeiling1And1ShouldReturn1()
 {
     Assert.AreEqual(1, PrimeMath.NearestCoprimeCeiling((uint)1, (uint)1), "uint");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeCeiling((int)1, (int)1), "int");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeCeiling((ulong)1, (ulong)1), "ulong");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeCeiling((long)1, (long)1), "long");
     Assert.AreEqual(UInt128.One, PrimeMath.NearestCoprimeCeiling((UInt128)1, (UInt128)1), "UInt128");
 }
Example #2
0
 public void NearestCoprimeCeiling10And15ShouldReturn11()
 {
     Assert.AreEqual(11, PrimeMath.NearestCoprimeCeiling((uint)10, (uint)15), "uint");
     Assert.AreEqual(11, PrimeMath.NearestCoprimeCeiling((int)10, (int)15), "int");
     Assert.AreEqual(11, PrimeMath.NearestCoprimeCeiling((ulong)10, (ulong)15), "ulong");
     Assert.AreEqual(11, PrimeMath.NearestCoprimeCeiling((long)10, (long)15), "long");
     Assert.AreEqual((UInt128)11, PrimeMath.NearestCoprimeCeiling((UInt128)10, (UInt128)15), "UInt128");
 }
Example #3
0
 public void NearestCoprimeCeiling2And0ShouldReturn0()
 {
     Assert.AreEqual(0, PrimeMath.NearestCoprimeCeiling(2, (uint)0), "uint");
     Assert.AreEqual(0, PrimeMath.NearestCoprimeCeiling(2, (int)0), "int");
     Assert.AreEqual(0, PrimeMath.NearestCoprimeCeiling((ulong)2, (ulong)0), "ulong");
     Assert.AreEqual(0, PrimeMath.NearestCoprimeCeiling((long)2, (long)0), "long");
     Assert.AreEqual(UInt128.Zero, PrimeMath.NearestCoprimeCeiling((UInt128)2, (UInt128)0), "UInt128");
 }
Example #4
0
 public void NearestCoprimeCeilingNeg10AndNeg15ShouldReturnNeg8()
 {
     Assert.AreEqual(-8, PrimeMath.NearestCoprimeCeiling((int)-10, (int)-15), "int");
     Assert.AreEqual(-8, PrimeMath.NearestCoprimeCeiling((long)-10, (long)-15), "long");
 }