void copy (Rational const &);
public:
void set_infinite (int sign);
bool is_infinity () const;
void invert ();
void copy (Rational const &);
public:
void set_infinite (int sign);
bool is_infinity () const;
void invert ();
- int numerator () const { return sign_ * num_; }
- int denominator () const { return den_; }
- int num () const { return numerator (); }
- int den () const { return denominator (); }
+ I64 numerator () const { return sign_ * num_; }
+ I64 denominator () const { return den_; }
+ I64 num () const { return numerator (); }
+ I64 den () const { return denominator (); }
Rational trunc_rat () const;
Rational div_rat (Rational) const;
Rational mod_rat (Rational) const;
Rational trunc_rat () const;
Rational div_rat (Rational) const;
Rational mod_rat (Rational) const;
Rational &operator %= (Rational);
static int compare (Rational const &, Rational const &);
int sign () const;
Rational &operator %= (Rational);
static int compare (Rational const &, Rational const &);
int sign () const;
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, /);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, +);
IMPLEMENT_ARITHMETIC_OPERATOR (Rational, *);