#include <rational.h>
Public Methods | |
| rational () | |
| rational (char *str) | |
| rational (const rational< T > &b) | |
| rational (int w) | |
| rational (T w) | |
| rational (T u, T v) | |
| rational< T > & | operator= (const rational< T > &b) |
Friends | |
| ostream & | operator<< (ostream &s, const rational< T > &x) |
| istream & | operator>> (istream &s, rational< T > &x) |
| int | sign (const rational< T > &a) |
| int | cmp (const rational< T > &a, const rational< T > &b) |
| int | operator== (const rational< T > &a, const rational< T > &b) |
| int | operator!= (const rational< T > &a, const rational< T > &b) |
| int | operator> (const rational< T > &a, const rational< T > &b) |
| int | operator>= (const rational< T > &a, const rational< T > &b) |
| int | operator< (const rational< T > &a, const rational< T > &b) |
| int | operator<= (const rational< T > &a, const rational< T > &b) |
| int | is_integer (const rational< T > &a) |
| rational< T > | ceil (const rational< T > &a) |
| rational< T > | floor (const rational< T > &a) |
| rational< T > | frac (const rational< T > &a) |
| T | iceil (const rational< T > &a) |
| T | ifloor (const rational< T > &a) |
| rational< T > | operator+ (const rational< T > &a) |
| rational< T > | operator- (const rational< T > &a) |
| rational< T > | operator+ (const rational< T > &b, const rational< T > &c) |
| rational< T > | operator- (const rational< T > &b, const rational< T > &c) |
| rational< T > | operator * (const rational< T > &b, const rational< T > &c) |
| rational< T > | operator/ (const rational< T > &b, const rational< T > &c) |
| int | sign (const rational< T > &a) |
| int | cmp (const rational< T > &a, const rational< T > &b) |
| rational< T > | operator+ (const rational< T > &a) |
| rational< T > | operator- (const rational< T > &a) |
An instance of this type is a rational number where the numerator and the denominator are both of type T.
|
|||||||||
|
Creates an instance of type rational.
|
|
||||||||||
|
Converts s to a rational number.
|
|
||||||||||
|
Makes a copy of a number.
|
|
||||||||||
|
Creates an instance and initializes it with the value of w.
|
|
||||||||||
|
Creates an instance and initializes it with the value of w.
|
|
|||||||||||||||||||
|
Creates an instance and initializes it with the value of u/w.
|
|
||||||||||
|
Assignment.
|
|
||||||||||
|
Returns the next bigger integer.
|
|
|||||||||||||||||||
|
Returns
|
|
|||||||||||||||||||
|
Compares two big integers. Returns
|
|
||||||||||
|
Returns the next smaller integer.
|
|
||||||||||
|
Returns the fractal part of the number.
|
|
||||||||||
|
Returns the next bigger integer.
|
|
||||||||||
|
Returns the next smaller integer.
|
|
||||||||||
|
Returns 1 if a is integer.
|
|
|||||||||||||||||||
|
Multiplication.
|
|
|||||||||||||||||||
|
Test for inequality.
|
|
||||||||||
|
Unary plus.
|
|
|||||||||||||||||||
|
Binary plus.
|
|
||||||||||
|
Unary plus.
|
|
||||||||||
|
Unary minus.
|
|
|||||||||||||||||||
|
Binary minus.
|
|
||||||||||
|
Unary minus.
|
|
|||||||||||||||||||
|
Divizion.
|
|
|||||||||||||||||||
|
Test for less.
|
|
|||||||||||||||||||
|
Writes a rational number.
|
|
|||||||||||||||||||
|
Test for less than or equal to.
|
|
|||||||||||||||||||
|
Test for equality.
|
|
|||||||||||||||||||
|
Test for greater.
|
|
|||||||||||||||||||
|
Test for greater than or equal to.
|
|
|||||||||||||||||||
|
Reads a rational number.
|
|
||||||||||
|
Returns
|
|
||||||||||
|
Sign of a number. Returns
|
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001