27 namespace OnixS {
namespace ICE {
namespace iMpact {
namespace MarketData {
45 Rational(
long long numerator,
unsigned int denominator);
66 operator float()
const;
69 operator double()
const;
72 std::string toString ()
const;
75 bool operator==(
const Rational& right)
const;
76 bool operator!=(
const Rational& right)
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;
84 ONIXS_ICEMDH_EXPORT std::ostream&
operator<<(std::ostream& stream,
const Rational& value);
109 template <
typename T>
115 inline Rational::operator float()
const 117 return convertTo<float>();
120 inline Rational::operator double()
const 122 return convertTo<double>();
135 return !(*
this == right);
148 return right < *
this;
153 return !(right < *
this);
158 return !(*
this < right);
bool noValue() const
Indicates if Rational has no value.
bool operator<=(const Rational &right) const
static const long long NO_VALUE
This value indicates that value is in not set.
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.
Rational()
Constructs default instance.
Rational number representation.
bool operator>=(const Rational &right) const
unsigned int denominator
Denominator.
bool operator==(const Rational &right) const
Rational comparison.
bool operator!=(const Rational &right) const
bool operator<(const Rational &right) const