Ejemplo n.º 1
0
void printFunction(Fraction<Complex<int>> _fraction) {
	int a = _fraction.Numerator().Real();
	int b = _fraction.Numerator().Imaginary();
	int c = _fraction.Denominator().Real();
	int d = _fraction.Denominator().Imaginary();

	cout << "(" << a << SIGN(b) << b << "i)" <<
		" / (" << c << SIGN(d) << d << "i)";
}
Ejemplo n.º 2
0
Fraction Fraction::operator / (const Fraction& rhs) const
{
    int newNumerator = Numerator() * rhs.DenominatorAsInt();
    int newDenominator = DenominatorAsInt() * rhs.Numerator();
    return Fraction(0, newNumerator, newDenominator);
}