Kaydet (Commit) ac07b515 authored tarafından Michael Stahl's avatar Michael Stahl

tools: print some Fractions

Change-Id: Idc4668cba7412d0b4a3e486a8629c7f95a701091
üst 230d05ea
......@@ -22,6 +22,7 @@
#include <sal/types.h>
#include <tools/toolsdllapi.h>
#include <memory>
#include <ostream>
#include <type_traits>
class SvStream;
......@@ -106,6 +107,14 @@ inline Fraction operator-( const Fraction& rVal1, double v2 ) { return rVal1 - F
inline Fraction operator*( const Fraction& rVal1, double v2 ) { return rVal1 * Fraction(v2); }
inline Fraction operator/( const Fraction& rVal1, double v2 ) { return rVal1 / Fraction(v2); }
template<typename charT, typename traits>
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & rStream, const Fraction& rFraction)
{
rStream << "(" << rFraction.GetNumerator() << "/" << rFraction.GetDenominator() << ")";
return rStream;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment