tools: print some Fractions
Change-Id: Idc4668cba7412d0b4a3e486a8629c7f95a701091
This commit is contained in:
@@ -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: */
|
||||
|
Reference in New Issue
Block a user