Esempio n. 1
0
 public void NearestCoprimeFloor10And15ShouldReturn8()
 {
     Assert.AreEqual(8, PrimeMath.NearestCoprimeFloor((uint)10, (uint)15), "uint");
     Assert.AreEqual(8, PrimeMath.NearestCoprimeFloor((int)10, (int)15), "int");
     Assert.AreEqual(8, PrimeMath.NearestCoprimeFloor((ulong)10, (ulong)15), "ulong");
     Assert.AreEqual(8, PrimeMath.NearestCoprimeFloor((long)10, (long)15), "long");
     Assert.AreEqual((UInt128)8, PrimeMath.NearestCoprimeFloor((UInt128)10, (UInt128)15), "UInt128");
 }
Esempio n. 2
0
 public void NearestCoprimeFloor1And1ShouldReturn1()
 {
     Assert.AreEqual(1, PrimeMath.NearestCoprimeFloor((uint)1, (uint)1), "uint");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeFloor((int)1, (int)1), "int");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeFloor((ulong)1, (ulong)1), "ulong");
     Assert.AreEqual(1, PrimeMath.NearestCoprimeFloor((long)1, (long)1), "long");
     Assert.AreEqual(UInt128.One, PrimeMath.NearestCoprimeFloor((UInt128)1, (UInt128)1), "UInt128");
 }
Esempio n. 3
0
 public void NearestCoprimeFloorNeg10AndNeg15ShouldReturnNeg11()
 {
     Assert.AreEqual(-11, PrimeMath.NearestCoprimeFloor((int)-10, (int)-15), "int");
     Assert.AreEqual(-11, PrimeMath.NearestCoprimeFloor((long)-10, (long)-15), "long");
 }
Esempio n. 4
0
 public void NearestCoprimeFloorNeg2And0ShouldReturn0()
 {
     Assert.AreEqual(0, PrimeMath.NearestCoprimeFloor((int)-2, (int)0), "int");
     Assert.AreEqual(0, PrimeMath.NearestCoprimeFloor((long)-2, (long)0), "long");
 }
Esempio n. 5
0
 public void NearestCoprimeFloor0And0SignedShouldReturnNeg1()
 {
     Assert.AreEqual(-1, PrimeMath.NearestCoprimeFloor((int)0, (int)0), "int");
     Assert.AreEqual(-1, PrimeMath.NearestCoprimeFloor((long)0, (long)0), "long");
 }
Esempio n. 6
0
 public void NearestCoprimeFloor0And0UnsignedShouldReturn0()
 {
     Assert.AreEqual(0, PrimeMath.NearestCoprimeFloor((uint)0, (uint)0), "uint");
     Assert.AreEqual(0, PrimeMath.NearestCoprimeFloor((ulong)0, (ulong)0), "ulong");
     Assert.AreEqual(UInt128.Zero, PrimeMath.NearestCoprimeFloor((UInt128)0, (UInt128)0), "UInt128");
 }