#include <Rational.h>
Public Member Functions | |
Rational () | |
Rational (double) | |
Rational (int n) | |
Rational (long n) | |
Rational (int n, int d) | |
Rational (long n, long d) | |
Rational (long n, unsigned long d) | |
Rational (unsigned long n, long d) | |
Rational (unsigned long n, unsigned long d) | |
Rational (const Integer &n) | |
Rational (const Integer &n, const Integer &d) | |
Rational (const Rational &) | |
~Rational () | |
Rational & | operator= (const Rational &y) |
int | operator== (const Rational &x) |
int | operator!= (const Rational &x) |
Rational & | operator+= (const Rational &y) |
Rational & | operator-= (const Rational &y) |
Rational & | operator *= (const Rational &y) |
Rational & | operator/= (const Rational &y) |
void | negate () |
void | invert () |
const Integer & | numerator () const |
const Integer & | denominator () const |
operator double () const | |
int | fits_in_float () const |
int | fits_in_double () const |
void | error (const char *msg) const |
int | OK () const |
Protected Member Functions | |
void | normalize () |
Protected Attributes | |
Integer | num |
Integer | den |
Friends | |
int | operator< (const Rational &x, const Rational &y) |
int | operator<= (const Rational &x, const Rational &y) |
int | operator> (const Rational &x, const Rational &y) |
int | operator>= (const Rational &x, const Rational &y) |
Rational | operator+ (const Rational &x, const Rational &y) |
Rational | operator- (const Rational &x, const Rational &y) |
Rational | operator * (const Rational &x, const Rational &y) |
Rational | operator/ (const Rational &x, const Rational &y) |
Rational | operator- (const Rational &x) |
int | sign (const Rational &x) |
Rational | abs (const Rational &x) |
Rational | sqr (const Rational &x) |
Rational | pow (const Rational &x, long y) |
Rational | pow (const Rational &x, const Integer &y) |
Integer | floor (const Rational &x) |
Integer | ceil (const Rational &x) |
Integer | trunc (const Rational &x) |
Integer | round (const Rational &x) |
istream & | operator>> (istream &s, Rational &y) |
ostream & | operator<< (ostream &s, const Rational &y) |
int | compare (const Rational &x, const Rational &y) |
void | add (const Rational &x, const Rational &y, Rational &dest) |
void | sub (const Rational &x, const Rational &y, Rational &dest) |
void | mul (const Rational &x, const Rational &y, Rational &dest) |
void | div (const Rational &x, const Rational &y, Rational &dest) |
Definition at line 8 of file Rational.h.
|
Definition at line 99 of file Rational.h. |
|
|
|
Definition at line 113 of file Rational.h. |
|
Definition at line 111 of file Rational.h. |
|
Definition at line 116 of file Rational.h. References normalize(). |
|
Definition at line 115 of file Rational.h. References normalize(). |
|
Definition at line 117 of file Rational.h. References normalize(). |
|
Definition at line 121 of file Rational.h. References normalize(). |
|
Definition at line 125 of file Rational.h. References normalize(). |
|
Definition at line 104 of file Rational.h. |
|
Definition at line 106 of file Rational.h. References normalize(). |
|
Definition at line 102 of file Rational.h. |
|
Definition at line 100 of file Rational.h. |
|
Definition at line 193 of file Rational.h. References den. |
|
|
|
|
|
|
|
|
|
Definition at line 162 of file Rational.h. References Integer::negate1(), and num. |
|
Referenced by Rational(). |
|
Definition at line 192 of file Rational.h. References num. |
|
|
|
Definition at line 180 of file Rational.h. References mul. |
|
Definition at line 194 of file Rational.h. |
|
Definition at line 35 of file Rational.h. |
|
Definition at line 168 of file Rational.h. References add. |
|
Definition at line 174 of file Rational.h. References sub. |
|
Definition at line 186 of file Rational.h. References div. |
|
Definition at line 130 of file Rational.h. |
|
Definition at line 34 of file Rational.h. |
|
|
|
Referenced by operator+=(). |
|
|
|
Referenced by operator!=(), and operator==(). |
|
Referenced by operator/=(). |
|
|
|
Referenced by operator *=(). |
|
Definition at line 206 of file Rational.h. |
|
Definition at line 196 of file Rational.h. |
|
|
|
Definition at line 201 of file Rational.h. |
|
Definition at line 211 of file Rational.h. |
|
Definition at line 137 of file Rational.h. |
|
|
|
Definition at line 142 of file Rational.h. |
|
Definition at line 147 of file Rational.h. |
|
Definition at line 152 of file Rational.h. |
|
|
|
|
|
|
|
|
|
Definition at line 157 of file Rational.h. |
|
|
|
Referenced by operator-=(). |
|
|
|
Definition at line 12 of file Rational.h. Referenced by denominator(), operator double(), operator!=(), operator=(), and operator==(). |
|
Definition at line 11 of file Rational.h. Referenced by negate(), numerator(), operator double(), operator!=(), operator=(), operator==(), and sign(). |