30 #ifndef __RATIONAL_GENERIC_H__
31 #define __RATIONAL_GENERIC_H__
95 template <
typename T> T
abs(
const T &r) {
97 if (rabs.a.isLessThan(0))
98 rabs.a.multiplyBy(-1);
103 #include "rational.tpp"
Definition: rational.h:37
Rational & operator*=(Rational const &n)
Rational operator-() const
Rational & operator/=(Rational const &n)
bool operator<(Rational const &) const
Rational & operator=(long int)
bool operator==(Rational const &) const
T a
Definition: rational.h:39
bool operator>=(int const &) const
Rational operator-(Rational const &n) const
Rational & operator-=(Rational const &n)
Rational operator+(Rational const &n) const
bool isOne
Definition: rational.h:46
T b
Definition: rational.h:40
void print(ostream &) const
bool hasDenominatorOne
Definition: rational.h:45
bool operator==(int const &) const
Rational & operator+=(Rational const &n)
bool operator!=(Rational const &) const
void update()
Met à jour les attributs (gcd, isInt, ...)
Rational operator*(Rational const &n) const
bool operator>(Rational const &) const
Rational operator/(Rational const &n) const
bool get_hasDenominatorOne() const
void opp(Rational *&_c) const
bool isMinusOne
Definition: rational.h:47
bool isZero
Definition: rational.h:44
ostream & operator<<(ostream &, Rational< T > const &)
T abs(const T &r)
Definition: rational.h:95