예제 #1
0
        /// <summary>
        /// 运算:除法
        /// </summary>
        /// <param name="numA"></param>
        /// <param name="numB"></param>
        /// <returns></returns>
        public static RationalNumber operator /(RationalNumber numA, RationalNumber numB)
        {
            RationalNumber num = numB.GetReciprocal();

            return(numA * num);
        }
예제 #2
0
        /// <summary>
        /// 运算:减法
        /// </summary>
        /// <param name="numA"></param>
        /// <param name="numB"></param>
        /// <returns></returns>
        public static RationalNumber operator -(RationalNumber numA, RationalNumber numB)
        {
            RationalNumber num = -numB;

            return(numA + num);
        }