*/
int sign_;
unsigned int num_, den_;
- void normalise ();
+ void normalize ();
void copy (Rational const &);
public:
Rational trunc_rat () const;
Rational div_rat (Rational) const;
Rational mod_rat (Rational) const;
+ Rational abs () const;
void negate ();
int to_int () const;
- operator bool () const;
+
operator double () const;
Rational operator - () const;
Initialize to 0.
*/
Rational ();
- Rational (int);
Rational (int, int);
Rational (double);
Rational (Rational const &r) { copy (r);}
};
#include "arithmetic-operator.hh"
+
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);