Exemplo n.º 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;
	}
Exemplo n.º 2
0
	constexpr Rational subtract(const Rational& rhs) const {
		return add(rhs.negate());
	}