Rational Class Reference

Represents a rational number. More...

#include <Rational.h>

Public Member Functions

 Rational (int numerator=0, unsigned denominator=1)
 
const Rationaloperator= (const Rational &)
 
bool operator== (const Rational &) const
 
bool operator!= (const Rational &) const
 
const Rationaloperator= (int num)
 
bool operator== (int num) const
 
bool operator!= (int num) const
 
int operator* (int num) const
 
double doubleValue () const
 
int normalize (int) const
 
int get_numerator () const
 
unsigned get_denominator () const
 

Friends

std::istream & operator>> (std::istream &in, Rational &r)
 
std::ostream & operator<< (std::ostream &out, const Rational &r)
 

Detailed Description

Represents a rational number.


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

Generated using doxygen 1.8.17