示例#1
0
        public void TestGreater()
        {
            IsGreater toNumber = new IsGreater();

            toNumber.Parameters = new List <Token>()
            {
                "12".toToken(CefType.NumberLiteral), "-2".toToken(CefType.NumberLiteral)
            };
            var res = toNumber.Exec(null);

            res.Wait();

            Assert.AreEqual((int)res.Result.Value, 1);
        }
示例#2
0
    public static void Sort <T>(T[] array, IsGreater <T> isArg1Greater)
    {
        int h = array.Length / 3;

        while (h > 0)
        {
            for (int i = h; i < array.Length; i++)
            {
                int j;
                T   dataObject = array[i];
                for (j = i; j >= h && isArg1Greater(array[j - h], dataObject); j -= h)
                {
                    array[j] = array[j - h];
                }
                array[j] = dataObject;
            }
            h /= 2;
        }
    }
示例#3
0
 RpnConst.Type.String => new RpnInteger(IsGreater(left.GetString(), right.GetString())),