示例#1
0
        // ( a b -- bool )
        public override void Execute(Interpreter interp)
        {
            ScalarItem b = (ScalarItem)interp.StackPop();
            ScalarItem a = (ScalarItem)interp.StackPop();

            interp.StackPush(new BoolItem(a.DoubleValue > b.DoubleValue));
        }
示例#2
0
        // ( a b -- a^b )
        public override void Execute(Interpreter interp)
        {
            ScalarItem b = (ScalarItem)interp.StackPop();
            ScalarItem a = (ScalarItem)interp.StackPop();

            interp.StackPush(new DoubleItem(Math.Pow(a.DoubleValue, b.DoubleValue)));
        }
示例#3
0
        // ( a -- sign )
        public override void Execute(Interpreter interp)
        {
            ScalarItem a = (ScalarItem)interp.StackPop();

            interp.StackPush(new IntItem(Math.Sign(a.IntValue)));
        }
示例#4
0
        public override int CompareTo(StackItem rhs)
        {
            ScalarItem r_val = (ScalarItem)rhs;

            return(DoubleValue.CompareTo(r_val.DoubleValue));
        }