eckit::Fraction class

Public types

using value_type = long long

Public static functions

static auto abs(const Fraction& f) -> Fraction
static auto fromString(const std::string&) -> Fraction
static auto max_denominator() -> Fraction::value_type

Constructors, destructors, conversion operators

Fraction()
Fraction(value_type top, value_type bottom)
Fraction(double n) explicit
Fraction(int n) explicit
Fraction(short n) explicit
Fraction(long n) explicit
Fraction(long long n) explicit
Fraction(unsigned int n) explicit
Fraction(unsigned short n) explicit
Fraction(unsigned long n) explicit
Fraction(unsigned long long n) explicit
Fraction(const std::string&) explicit
Fraction(const char*) explicit
operator double() const
operator value_type() const

Public functions

auto integer() const -> bool
auto operator-() const -> Fraction
auto integralPart() const -> value_type
auto decimalPart() const -> Fraction
auto inverse() const -> Fraction
void hash(eckit::MD5&) const
auto numerator() const -> value_type
auto denominator() const -> value_type
auto operator+(const Fraction&) const -> Fraction
auto operator-(const Fraction&) const -> Fraction
auto operator/(const Fraction&) const -> Fraction
auto operator*(const Fraction&) const -> Fraction
auto operator==(const Fraction&) const -> bool
auto operator<(const Fraction&) const -> bool
auto operator<=(const Fraction&) const -> bool
auto operator!=(const Fraction&) const -> bool
auto operator>(const Fraction&) const -> bool
auto operator>=(const Fraction&) const -> bool
auto operator+=(const Fraction& other) -> Fraction&
auto operator-=(const Fraction& other) -> Fraction&
auto operator/=(const Fraction& other) -> Fraction&
auto operator*=(const Fraction& other) -> Fraction&
template<class T>
auto operator+(T other) const -> Fraction
template<class T>
auto operator-(T other) const -> Fraction
template<class T>
auto operator/(T other) const -> Fraction
template<class T>
auto operator*(T other) const -> Fraction
template<class T>
auto operator==(T other) const -> bool
template<class T>
auto operator<(T other) const -> bool
template<class T>
auto operator<=(T other) const -> bool
template<class T>
auto operator!=(T other) const -> bool
template<class T>
auto operator>(T other) const -> bool
template<class T>
auto operator>=(T other) const -> bool
template<class T>
auto operator+=(T other) -> Fraction&
template<class T>
auto operator-=(T other) -> Fraction&
template<class T>
auto operator/=(T other) -> Fraction&
template<class T>
auto operator*=(T other) -> Fraction&
auto stableVersion(size_t max = 1000000) const -> Fraction
template<>
auto operator==(double) const -> bool
template<>
auto operator<(double) const -> bool
template<>
auto operator<=(double) const -> bool
template<>
auto operator!=(double) const -> bool
template<>
auto operator>(double) const -> bool
template<>
auto operator>=(double) const -> bool

Friends

auto operator<<(std::ostream& s, const Fraction& x) -> std::ostream&
auto operator<<(Stream& s, const Fraction& x) -> Stream&
auto operator>>(Stream& s, Fraction& x) -> Stream&