Example #1
0
        internal Operation(string expression)
        {
            double leftOperand;
            double rightOperand;
            char   @operator;

            Valid = Parser.TryParseExpression(expression, out leftOperand, out rightOperand, out @operator);
            if (!Valid)
            {
                return;
            }
            if (Math.Abs(leftOperand) >= double.Epsilon && Math.Abs(rightOperand) < double.Epsilon && @operator == '/')
            {
                IO.WriteDivideByZero();
                Valid = false;
                return;
            }
            LeftOperand  = leftOperand;
            RightOperand = rightOperand;
            Operator     = @operator;
        }