22 #ifndef COMMON_RATIONAL_H 23 #define COMMON_RATIONAL_H 25 #include "common/scummsys.h" 26 #include "common/frac.h" 67 const Rational operator+(
int right)
const;
68 const Rational operator-(
int right)
const;
69 const Rational operator*(
int right)
const;
70 const Rational operator/(
int right)
const;
72 bool operator==(
const Rational &right)
const;
73 bool operator!=(
const Rational &right)
const;
74 bool operator>(
const Rational &right)
const;
75 bool operator<(
const Rational &right)
const;
76 bool operator>=(
const Rational &right)
const;
77 bool operator<=(
const Rational &right)
const;
79 bool operator==(
int right)
const;
80 bool operator!=(
int right)
const;
81 bool operator>(
int right)
const;
82 bool operator<(
int right)
const;
83 bool operator>=(
int right)
const;
84 bool operator<=(
int right)
const;
90 double toDouble()
const;
93 int getNumerator()
const {
return _num; }
94 int getDenominator()
const {
return _denom; }
96 bool isOne()
const {
return _num == _denom; }
98 void debugPrint(
int debuglevel = 0,
const char *caption =
"Rational:")
const;
112 bool operator==(
int left,
const Rational &right);
113 bool operator!=(
int left,
const Rational &right);
114 bool operator>(
int left,
const Rational &right);
115 bool operator<(
int left,
const Rational &right);
116 bool operator>=(
int left,
const Rational &right);
117 bool operator<=(
int left,
const Rational &right);
Definition: rational.h:40
Definition: algorithm.h:29
int32 frac_t
Definition: frac.h:52