示例#1
0
        public override void execute(MK52_Host components, string command)
        {
            RPN_Stack s = _dealWithClergy1(components);

            if (s == null)
            {
                return;
            }
            s.storeBx();
            if (s.X.isInt())
            {
                switch (s.X.toInt())
                {
                case -1:
                    s.OctantToX(-1);
                    return;

                case 0:
                    s.OctantToX(0);
                    return;

                case 1:
                    s.OctantToX(1);
                    return;

                default:
                    break;
                }
            }
            double result = s.X.toReal();

            if (double.IsNegativeInfinity(result))
            {
                s.OctantToX(-2);
                return;
            }
            if (double.IsPositiveInfinity(result))
            {
                s.OctantToX(2);
                return;
            }
            result = Math.Atan(result);
            s.RadianToX(result);
        }
示例#2
0
        public override void execute(MK52_Host components, string command)
        {
            RPN_Stack s = _dealWithClergy1(components);

            if (s == null)
            {
                return;
            }
            s.storeBx();
            if (s.X.isInt())
            {
                switch (s.X.toInt())
                {
                case -1:
                    s.OctantToX(-4);
                    return;

                case 0:
                    s.OctantToX(2);
                    return;

                case 1:
                    s.OctantToX(0);
                    return;

                default:
                    s.X.fromReal(double.NaN);
                    return;
                }
            }
            double result = s.X.toReal();

            if (result < -1.0 || 1.0 < result)
            {
                s.X.fromReal(double.NaN);
                return;
            }
            result = Math.Acos(result);
            s.RadianToX(result);
        }