public static void sbyte8() { Random8 rng = new Random8(135); for (int i = 0; i < 64; i++) { sbyte8 x = rng.NextSByte8(); sbyte8 y = rng.NextSByte8(); Assert.AreEqual(new byte8((byte)_gcd(x.x0, y.x0), (byte)_gcd(x.x1, y.x1), (byte)_gcd(x.x2, y.x2), (byte)_gcd(x.x3, y.x3), (byte)_gcd(x.x4, y.x4), (byte)_gcd(x.x5, y.x5), (byte)_gcd(x.x6, y.x6), (byte)_gcd(x.x7, y.x7)), maxmath.gcd(x, y)); } }
public static void sbyte8() { Random8 rng = new Random8(135); for (int i = 0; i < 64; i++) { sbyte8 x = rng.NextSByte8(); Assert.AreEqual(new sbyte8((sbyte)maxmath.lzcnt(x.x0), (sbyte)maxmath.lzcnt(x.x1), (sbyte)maxmath.lzcnt(x.x2), (sbyte)maxmath.lzcnt(x.x3), (sbyte)maxmath.lzcnt(x.x4), (sbyte)maxmath.lzcnt(x.x5), (sbyte)maxmath.lzcnt(x.x6), (sbyte)maxmath.lzcnt(x.x7)), maxmath.lzcnt(x)); } }
public static void sbyte8() { Random8 rng = new Random8(135); for (int i = 0; i < 64; i++) { sbyte8 x = rng.NextSByte8(); byte8 n = rng.NextByte8(); Assert.AreEqual(new sbyte8((sbyte)_intpow(x.x0, n.x0), (sbyte)_intpow(x.x1, n.x1), (sbyte)_intpow(x.x2, n.x2), (sbyte)_intpow(x.x3, n.x3), (sbyte)_intpow(x.x4, n.x4), (sbyte)_intpow(x.x5, n.x5), (sbyte)_intpow(x.x6, n.x6), (sbyte)_intpow(x.x7, n.x7)), maxmath.intpow(x, n)); } }