Пример #1
0
        public bool DoNextOperation()
        {
            string op          = "";
            bool   ret         = false;
            bool   checkValues = false;

            BigInteger snnum1 = 0;
            BigInteger snnum2 = 0;
            BigInteger snnum3 = 0;
            BigInteger mynum1 = 0;
            BigInteger mynum2 = 0;
            BigInteger mynum3 = 0;

            if (operators.Count == 0)
            {
                return(false);
            }
            op = operators.Dequeue();

            if (op.StartsWith("u"))
            {
                checkValues = true;

                snnum1 = snCalc.Pop();
                snCalc.Push(DoUnaryOperatorSN(snnum1, op));

                mynum1 = myCalc.Pop();
                myCalc.Push(MyBigIntImp.DoUnaryOperatorMine(mynum1, op));

                ret = true;
            }
            else if (op.StartsWith("b"))
            {
                checkValues = true;

                snnum1 = snCalc.Pop();
                snnum2 = snCalc.Pop();
                snCalc.Push(DoBinaryOperatorSN(snnum1, snnum2, op));

                mynum1 = myCalc.Pop();
                mynum2 = myCalc.Pop();
                myCalc.Push(MyBigIntImp.DoBinaryOperatorMine(mynum1, mynum2, op));

                ret = true;
            }
            else if (op.StartsWith("t"))
            {
                checkValues = true;
                snnum1      = snCalc.Pop();
                snnum2      = snCalc.Pop();
                snnum3      = snCalc.Pop();

                snCalc.Push(DoTertanaryOperatorSN(snnum1, snnum2, snnum3, op));

                mynum1 = myCalc.Pop();
                mynum2 = myCalc.Pop();
                mynum3 = myCalc.Pop();
                myCalc.Push(MyBigIntImp.DoTertanaryOperatorMine(mynum1, mynum2, mynum3, op));

                ret = true;
            }
            else
            {
                if (op.Equals("make"))
                {
                    snnum1 = DoConstruction();
                    snCalc.Push(snnum1);
                    myCalc.Push(snnum1);
                }
                else if (op.Equals("Corruption"))
                {
                    snCalc.Push(-33);
                    myCalc.Push(-555);
                }
                else if (BigInteger.TryParse(op, out snnum1))
                {
                    snCalc.Push(snnum1);
                    myCalc.Push(snnum1);
                }
                else
                {
                    Console.WriteLine("Failed to parse string {0}", op);
                }

                ret = true;
            }

            if (checkValues)
            {
                if ((snnum1 != mynum1) || (snnum2 != mynum2) || (snnum3 != mynum3))
                {
                    operators.Enqueue("Corruption");
                }
            }

            return(ret);
        }
Пример #2
0
        public static void RunTests()
        {
            int cycles = 1;

            //Get the BigIntegers to be testing;
            b1      = new BigInteger(GetRandomByteArray(s_random));
            b2      = new BigInteger(GetRandomByteArray(s_random));
            b3      = new BigInteger(GetRandomByteArray(s_random));
            results = new BigInteger[32][];
            // ...Sign
            results[0]    = new BigInteger[3];
            results[0][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "uSign");
            results[0][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "uSign");
            results[0][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "uSign");
            // ...Op ~
            results[1]    = new BigInteger[3];
            results[1][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "u~");
            results[1][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "u~");
            results[1][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "u~");
            // ...Log10
            results[2]    = new BigInteger[3];
            results[2][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "uLog10");
            results[2][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "uLog10");
            results[2][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "uLog10");
            // ...Log
            results[3]    = new BigInteger[3];
            results[3][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "uLog");
            results[3][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "uLog");
            results[3][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "uLog");
            // ...Abs
            results[4]    = new BigInteger[3];
            results[4][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "uAbs");
            results[4][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "uAbs");
            results[4][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "uAbs");
            // ...Op --
            results[5]    = new BigInteger[3];
            results[5][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "u--");
            results[5][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "u--");
            results[5][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "u--");
            // ...Op ++
            results[6]    = new BigInteger[3];
            results[6][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "u++");
            results[6][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "u++");
            results[6][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "u++");
            // ...Negate
            results[7]    = new BigInteger[3];
            results[7][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "uNegate");
            results[7][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "uNegate");
            results[7][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "uNegate");
            // ...Op -
            results[8]    = new BigInteger[3];
            results[8][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "u-");
            results[8][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "u-");
            results[8][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "u-");
            // ...Op +
            results[9]    = new BigInteger[3];
            results[9][0] = MyBigIntImp.DoUnaryOperatorMine(b1, "u+");
            results[9][1] = MyBigIntImp.DoUnaryOperatorMine(b2, "u+");
            results[9][2] = MyBigIntImp.DoUnaryOperatorMine(b3, "u+");
            // ...Min
            results[10]    = new BigInteger[9];
            results[10][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bMin");
            results[10][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bMin");
            results[10][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bMin");
            results[10][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bMin");
            results[10][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bMin");
            results[10][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bMin");
            results[10][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bMin");
            results[10][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bMin");
            results[10][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bMin");
            // ...Max
            results[11]    = new BigInteger[9];
            results[11][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bMax");
            results[11][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bMax");
            results[11][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bMax");
            results[11][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bMax");
            results[11][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bMax");
            results[11][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bMax");
            results[11][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bMax");
            results[11][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bMax");
            results[11][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bMax");
            // ...Op >>
            results[12]    = new BigInteger[9];
            results[12][0] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b1), "b>>");
            results[12][1] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b2), "b>>");
            results[12][2] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b3), "b>>");
            results[12][3] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b1), "b>>");
            results[12][4] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b2), "b>>");
            results[12][5] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b3), "b>>");
            results[12][6] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b1), "b>>");
            results[12][7] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b2), "b>>");
            results[12][8] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b3), "b>>");
            // ...Op <<
            results[13]    = new BigInteger[9];
            results[13][0] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b1), "b<<");
            results[13][1] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b2), "b<<");
            results[13][2] = MyBigIntImp.DoBinaryOperatorMine(b1, Makeint(b3), "b<<");
            results[13][3] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b1), "b<<");
            results[13][4] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b2), "b<<");
            results[13][5] = MyBigIntImp.DoBinaryOperatorMine(b2, Makeint(b3), "b<<");
            results[13][6] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b1), "b<<");
            results[13][7] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b2), "b<<");
            results[13][8] = MyBigIntImp.DoBinaryOperatorMine(b3, Makeint(b3), "b<<");
            // ...Op ^
            results[14]    = new BigInteger[9];
            results[14][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b^");
            results[14][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b^");
            results[14][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b^");
            results[14][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b^");
            results[14][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b^");
            results[14][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b^");
            results[14][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b^");
            results[14][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b^");
            results[14][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b^");
            // ...Op |
            results[15]    = new BigInteger[9];
            results[15][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b|");
            results[15][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b|");
            results[15][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b|");
            results[15][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b|");
            results[15][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b|");
            results[15][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b|");
            results[15][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b|");
            results[15][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b|");
            results[15][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b|");
            // ...Op &
            results[16]    = new BigInteger[9];
            results[16][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b&");
            results[16][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b&");
            results[16][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b&");
            results[16][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b&");
            results[16][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b&");
            results[16][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b&");
            results[16][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b&");
            results[16][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b&");
            results[16][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b&");
            // ...Log
            results[17]    = new BigInteger[9];
            results[17][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bLog");
            results[17][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bLog");
            results[17][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bLog");
            results[17][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bLog");
            results[17][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bLog");
            results[17][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bLog");
            results[17][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bLog");
            results[17][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bLog");
            results[17][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bLog");
            // ...GCD
            results[18]    = new BigInteger[9];
            results[18][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bGCD");
            results[18][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bGCD");
            results[18][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bGCD");
            results[18][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bGCD");
            results[18][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bGCD");
            results[18][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bGCD");
            results[18][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bGCD");
            results[18][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bGCD");
            results[18][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bGCD");
            // ...DivRem
            results[20]    = new BigInteger[9];
            results[20][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bDivRem");
            results[20][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bDivRem");
            results[20][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bDivRem");
            results[20][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bDivRem");
            results[20][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bDivRem");
            results[20][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bDivRem");
            results[20][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bDivRem");
            results[20][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bDivRem");
            results[20][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bDivRem");
            // ...Remainder
            results[21]    = new BigInteger[9];
            results[21][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bRemainder");
            results[21][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bRemainder");
            results[21][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bRemainder");
            results[21][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bRemainder");
            results[21][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bRemainder");
            results[21][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bRemainder");
            results[21][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bRemainder");
            results[21][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bRemainder");
            results[21][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bRemainder");
            // ...Op %
            results[22]    = new BigInteger[9];
            results[22][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b%");
            results[22][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b%");
            results[22][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b%");
            results[22][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b%");
            results[22][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b%");
            results[22][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b%");
            results[22][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b%");
            results[22][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b%");
            results[22][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b%");
            // ...Divide
            results[23]    = new BigInteger[9];
            results[23][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bDivide");
            results[23][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bDivide");
            results[23][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bDivide");
            results[23][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bDivide");
            results[23][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bDivide");
            results[23][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bDivide");
            results[23][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bDivide");
            results[23][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bDivide");
            results[23][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bDivide");
            // ...Op /
            results[24]    = new BigInteger[9];
            results[24][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b/");
            results[24][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b/");
            results[24][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b/");
            results[24][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b/");
            results[24][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b/");
            results[24][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b/");
            results[24][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b/");
            results[24][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b/");
            results[24][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b/");
            // ...Multiply
            results[25]    = new BigInteger[9];
            results[25][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bMultiply");
            results[25][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bMultiply");
            results[25][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bMultiply");
            results[25][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bMultiply");
            results[25][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bMultiply");
            results[25][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bMultiply");
            results[25][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bMultiply");
            results[25][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bMultiply");
            results[25][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bMultiply");
            // ...Op *
            results[26]    = new BigInteger[9];
            results[26][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b*");
            results[26][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b*");
            results[26][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b*");
            results[26][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b*");
            results[26][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b*");
            results[26][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b*");
            results[26][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b*");
            results[26][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b*");
            results[26][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b*");
            // ...Subtract
            results[27]    = new BigInteger[9];
            results[27][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bSubtract");
            results[27][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bSubtract");
            results[27][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bSubtract");
            results[27][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bSubtract");
            results[27][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bSubtract");
            results[27][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bSubtract");
            results[27][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bSubtract");
            results[27][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bSubtract");
            results[27][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bSubtract");
            // ...Op -
            results[28]    = new BigInteger[9];
            results[28][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b-");
            results[28][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b-");
            results[28][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b-");
            results[28][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b-");
            results[28][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b-");
            results[28][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b-");
            results[28][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b-");
            results[28][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b-");
            results[28][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b-");
            // ...Add
            results[29]    = new BigInteger[9];
            results[29][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "bAdd");
            results[29][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "bAdd");
            results[29][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "bAdd");
            results[29][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "bAdd");
            results[29][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "bAdd");
            results[29][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "bAdd");
            results[29][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "bAdd");
            results[29][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "bAdd");
            results[29][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "bAdd");
            // ...Op +
            results[30]    = new BigInteger[9];
            results[30][0] = MyBigIntImp.DoBinaryOperatorMine(b1, b1, "b+");
            results[30][1] = MyBigIntImp.DoBinaryOperatorMine(b1, b2, "b+");
            results[30][2] = MyBigIntImp.DoBinaryOperatorMine(b1, b3, "b+");
            results[30][3] = MyBigIntImp.DoBinaryOperatorMine(b2, b1, "b+");
            results[30][4] = MyBigIntImp.DoBinaryOperatorMine(b2, b2, "b+");
            results[30][5] = MyBigIntImp.DoBinaryOperatorMine(b2, b3, "b+");
            results[30][6] = MyBigIntImp.DoBinaryOperatorMine(b3, b1, "b+");
            results[30][7] = MyBigIntImp.DoBinaryOperatorMine(b3, b2, "b+");
            results[30][8] = MyBigIntImp.DoBinaryOperatorMine(b3, b3, "b+");
            // ...ModPow
            results[31]     = new BigInteger[27];
            results[31][0]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b1 < 0 ? -b1 : b1), b1, "tModPow");
            results[31][1]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b1 < 0 ? -b1 : b1), b2, "tModPow");
            results[31][2]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b1 < 0 ? -b1 : b1), b3, "tModPow");
            results[31][3]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b2 < 0 ? -b2 : b2), b1, "tModPow");
            results[31][4]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b2 < 0 ? -b2 : b2), b2, "tModPow");
            results[31][5]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b2 < 0 ? -b2 : b2), b3, "tModPow");
            results[31][6]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b3 < 0 ? -b3 : b3), b1, "tModPow");
            results[31][7]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b3 < 0 ? -b3 : b3), b2, "tModPow");
            results[31][8]  = MyBigIntImp.DoTertanaryOperatorMine(b1, (b3 < 0 ? -b3 : b3), b3, "tModPow");
            results[31][9]  = MyBigIntImp.DoTertanaryOperatorMine(b2, (b1 < 0 ? -b1 : b1), b1, "tModPow");
            results[31][10] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b1 < 0 ? -b1 : b1), b2, "tModPow");
            results[31][11] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b1 < 0 ? -b1 : b1), b3, "tModPow");
            results[31][12] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b2 < 0 ? -b2 : b2), b1, "tModPow");
            results[31][13] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b2 < 0 ? -b2 : b2), b2, "tModPow");
            results[31][14] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b2 < 0 ? -b2 : b2), b3, "tModPow");
            results[31][15] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b3 < 0 ? -b3 : b3), b1, "tModPow");
            results[31][16] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b3 < 0 ? -b3 : b3), b2, "tModPow");
            results[31][17] = MyBigIntImp.DoTertanaryOperatorMine(b2, (b3 < 0 ? -b3 : b3), b3, "tModPow");
            results[31][18] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b1 < 0 ? -b1 : b1), b1, "tModPow");
            results[31][19] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b1 < 0 ? -b1 : b1), b2, "tModPow");
            results[31][20] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b1 < 0 ? -b1 : b1), b3, "tModPow");
            results[31][21] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b2 < 0 ? -b2 : b2), b1, "tModPow");
            results[31][22] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b2 < 0 ? -b2 : b2), b2, "tModPow");
            results[31][23] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b2 < 0 ? -b2 : b2), b3, "tModPow");
            results[31][24] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b3 < 0 ? -b3 : b3), b1, "tModPow");
            results[31][25] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b3 < 0 ? -b3 : b3), b2, "tModPow");
            results[31][26] = MyBigIntImp.DoTertanaryOperatorMine(b3, (b3 < 0 ? -b3 : b3), b3, "tModPow");

            for (int i = 0; i < cycles; i++)
            {
                Worker worker = new Worker(new Random(s_random.Next()), i);
                worker.DoWork();
                Assert.True(worker.Valid, "Verification Failed");
            }
        }