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);
111 template <
typename T>
117 inline Rational::operator float()
const 119 return convertTo<float>();
122 inline Rational::operator double()
const 124 return convertTo<double>();
139 return !(*
this == right);
154 return right < *
this;
159 return !(right < *
this);
164 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.