コード例 #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);
        }