コード例 #1
0
        /// <summary>
        /// Division counting
        /// </summary>
        /// <returns>Result of division</returns>
        public override double Counting()
        {
            double value1 = LeftChild.Counting();
            double value2 = RightChild.Counting();

            if (value2 == 0)
            {
                throw new DivideByZeroException();
            }
            return(value1 / value2);
        }
コード例 #2
0
 /// <summary>
 /// Subtraction's counting
 /// </summary>
 /// <returns>Subtraction's result</returns>
 public override double Counting()
 => LeftChild.Counting() - RightChild.Counting();