Go::Rational Class Reference
['utils' - a collection of useful math and programming tools]

Class representing rational numbers. More...

#include <Rational.h>

List of all members.

Public Member Functions

 Rational ()
 Construct a rational number whose value is 0.
 Rational (int p)
 Construct a rational number whose value is 'p' (integer).
 Rational (int p, int q)
 Construct a rational number whose value is 'p'/'q' (fraction).
Rationaloperator+= (const Rational &other)
 Add a different rational number to this rational number.
Rationaloperator-= (const Rational &other)
 Subtract a different rational number from this rational number.
Rationaloperator *= (const Rational &other)
 Multiply this rational number with a different rational number.
Rationaloperator/= (const Rational &other)
 Divide this rational number by a different rational number.
Rational operator- () const
 Return the additive inverse of this rational number.
bool operator== (const Rational r)
 Test this rational number for equality with another rational number.
bool operator!= (const Rational r)
 Test this rational number for difference with another rational number.
void write (std::ostream &os) const
 Write this rational number to a stream.
void simplify ()
 Simplify the internal fractional expression of this rational number.


Detailed Description

Class representing rational numbers.

Definition at line 48 of file Rational.h.


The documentation for this class was generated from the following file:
Generated on Mon Jun 11 14:48:19 2007 for GoTools Core Library by  doxygen 1.5.1