示例#1
0
	Rational Rational::operator-=(const Rational& rationalObj) {
		// make copy of the rational object
		Rational tmp = Rational(rationalObj);

		// negate
		tmp = tmp.negate();

		// add
		return *this += tmp;
	}
示例#2
0
文件: rational.hpp 项目: agul/algolib
	constexpr Rational subtract(const Rational& rhs) const {
		return add(rhs.negate());
	}