24 #include <OnixS/Senaf/MarketData/Export.h> 29 namespace OnixS {
namespace Senaf {
namespace MarketData {
47 Rational(
long long numerator,
unsigned int denominator);
68 operator float()
const;
71 operator double()
const;
74 std::string toString()
const;
77 bool operator==(
const Rational& right)
const;
78 bool operator!=(
const Rational& right)
const;
79 bool operator<(
const Rational& right)
const;
80 bool operator>(
const Rational& right)
const;
81 bool operator<=(
const Rational& right)
const;
82 bool operator>=(
const Rational& right)
const;
86 ONIXS_BME_SENAF_EXPORT std::ostream&
operator<<(std::ostream& stream,
const Rational& value);
103 : int(other.
convertTo<double>() * newDenominator)
114 template <
typename T>
120 inline Rational::operator float()
const 122 return convertTo<float>();
125 inline Rational::operator double()
const 127 return convertTo<double>();
142 return !(*
this == right);
157 return right < *
this;
162 return !(right < *
this);
167 return !(*
this < right);
bool operator<=(const Rational &right) const
bool operator>(const Rational &right) const
bool operator>=(const Rational &right) const
unsigned int denominator
Denominator.
Rational()
Constructs default instance.
bool operator!=(const Rational &right) const
Rational number representation.
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
bool operator<(const Rational &right) const
long long numerator
Numerator.
static const long long NO_VALUE
This value indicates that value is in not set.
bool operator==(const Rational &right) const
Rational comparison.
bool noValue() const
Indicates if Rational has no value.