Exemple #1
0
        public static void byte8()
        {
            Random8 rng = new Random8(135);

            for (int i = 0; i < 64; i++)
            {
                byte8 x = rng.NextByte8();
                byte8 y = rng.NextByte8();

                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));
            }
        }
Exemple #2
0
        public static void byte8()
        {
            Random8 rng = new Random8(135);

            for (int i = 0; i < 64; i++)
            {
                byte8 x = rng.NextByte8();

                Assert.AreEqual(new byte8((byte)_intsqrt(x.x0),
                                          (byte)_intsqrt(x.x1),
                                          (byte)_intsqrt(x.x2),
                                          (byte)_intsqrt(x.x3),
                                          (byte)_intsqrt(x.x4),
                                          (byte)_intsqrt(x.x5),
                                          (byte)_intsqrt(x.x6),
                                          (byte)_intsqrt(x.x7)),
                                maxmath.intsqrt(x));
            }
        }
Exemple #3
0
        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));
            }
        }