Rational Class Reference

Structure for holding fractions. More...

#include <types.h>

List of all members.

Public Member Functions

 Rational ()
 Build an empty Rational.
 Rational (Int32 Num, Int32 Den)
 Initialise a Rational with a value.
Int32 GreatestCommonDivisor (void)
 Determine the greatest common divisor using the Euclidean algorithm.
void Reduce (void)
 Reduce a rational to its lowest integer form.
bool operator== (const Rational &RHS)
 Check for exact equality (not just the same ratio).

Public Attributes

Int32 Numerator
 Numerator of the fraction (top number).
Int32 Denominator
 Denominator of the fraction (bottom number).


Detailed Description

Structure for holding fractions.


Constructor & Destructor Documentation

Rational (  )  [inline]

Build an empty Rational.

Rational ( Int32  Num,
Int32  Den 
) [inline]

Initialise a Rational with a value.


Member Function Documentation

Int32 GreatestCommonDivisor ( void   )  [inline]

Determine the greatest common divisor using the Euclidean algorithm.

The larger value for Euclidean algorithm

The smaller value for Euclidean algorithm

void Reduce ( void   )  [inline]

Reduce a rational to its lowest integer form.

bool operator== ( const Rational RHS  )  [inline]

Check for exact equality (not just the same ratio).


Member Data Documentation

Int32 Numerator

Numerator of the fraction (top number).

Int32 Denominator

Denominator of the fraction (bottom number).


The documentation for this class was generated from the following file:
Generated on Mon Apr 2 15:21:02 2007 for MXFLib by  doxygen 1.5.1-p1