#include "Fraction.h" namespace ecci { /*static*/ Integer Fraction::greatestCommonDivisor(Integer a, Integer b) { a = a >= 0 ? a : -a; b = b >= 0 ? b : -b; while ( b > 0 ) { Integer t = b; b = a % b; a = t; } return a; } } // namespace ecci std::ostream& operator<<(std::ostream& out, const ecci::Fraction& fraction) { return out << fraction.getNumerator() << '/' << fraction.getDenominator(); }