ostream & operator <<
ostream & operator <<
(ostream & out, const rational & value)
{ // print representation of rational number on an output streamout << value.numerator() << '/' << value.denominator();return out;
}
Avoid the right shift of signed integer values.
Previous slide
Next slide
Back to first slide
View graphic version