CFraction Class Reference

#include <fraction.h>

List of all members.

Public Member Functions

 CFraction (const int num=0, const int den=1)
 CFraction (const double v)
 CFraction (CString &f)
 ~CFraction ()
bool isFraction () const
long long int numerator () const
long long int denominator () const
double value () const
void doubleToFraction (const double v, const double precision=1e-15)
CFraction lowestTerm () const
CFraction operator+ (const CFraction &rhs)
CFraction operator- (const CFraction &rhs)
CFraction operator* (const CFraction &rhs)
CFraction operator/ (const CFraction &rhs)
bool operator== (const CFraction &rhs) const
bool operator!= (const CFraction &rhs)
bool operator> (const CFraction &rhs)
bool operator< (const CFraction &rhs)
ostream & print (ostream &out)

Private Attributes

bool fraction
double val
long long int num
long long int den


ostream & operator<< (ostream &out, CFraction &f)

Constructor & Destructor Documentation

CFraction::CFraction ( const int  num = 0,
const int  den = 1 
) [inline]
CFraction::CFraction ( const double  v  )  [inline]
CFraction::CFraction ( CString f  )  [inline]
CFraction::~CFraction (  )  [inline]

Member Function Documentation

void CFraction::doubleToFraction ( const double  v,
const double  precision = 1e-15 
) [inline]

References val.

bool CFraction::isFraction (  )  const [inline]
bool CFraction::operator!= ( const CFraction rhs  )  [inline]
CFraction CFraction::operator* ( const CFraction rhs  )  [inline]
CFraction CFraction::operator+ ( const CFraction rhs  )  [inline]
CFraction CFraction::operator- ( const CFraction rhs  )  [inline]
CFraction CFraction::operator/ ( const CFraction rhs  )  [inline]
bool CFraction::operator< ( const CFraction rhs  )  [inline]
bool CFraction::operator== ( const CFraction rhs  )  const [inline]
bool CFraction::operator> ( const CFraction rhs  )  [inline]
ostream& CFraction::print ( ostream &  out  )  [inline]

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
CFraction f 
) [friend]

Member Data Documentation

long long int CFraction::den [private]
bool CFraction::fraction [private]

Referenced by denominator().

long long int CFraction::num [private]

Referenced by value().

double CFraction::val [private]

Referenced by doubleToFraction().

The documentation for this class was generated from the following file: