ScummVM API documentation
Common::Rational Class Reference

#include <rational.h>

Public Member Functions

 Rational (int num)
 
 Rational (int num, int denom)
 
 Rational (const Rational &rational)
 
Rationaloperator= (const Rational &right)
 
Rationaloperator= (int right)
 
Rationaloperator+= (const Rational &right)
 
Rationaloperator-= (const Rational &right)
 
Rationaloperator*= (const Rational &right)
 
Rationaloperator/= (const Rational &right)
 
Rationaloperator+= (int right)
 
Rationaloperator-= (int right)
 
Rationaloperator*= (int right)
 
Rationaloperator/= (int right)
 
const Rational operator- () const
 
const Rational operator+ (const Rational &right) const
 
const Rational operator- (const Rational &right) const
 
const Rational operator* (const Rational &right) const
 
const Rational operator/ (const Rational &right) const
 
const Rational operator+ (int right) const
 
const Rational operator- (int right) const
 
const Rational operator* (int right) const
 
const Rational operator/ (int right) const
 
bool operator== (const Rational &right) const
 
bool operator!= (const Rational &right) const
 
bool operator> (const Rational &right) const
 
bool operator< (const Rational &right) const
 
bool operator>= (const Rational &right) const
 
bool operator<= (const Rational &right) const
 
bool operator== (int right) const
 
bool operator!= (int right) const
 
bool operator> (int right) const
 
bool operator< (int right) const
 
bool operator>= (int right) const
 
bool operator<= (int right) const
 
void invert ()
 
Rational getInverse () const
 
int toInt () const
 
double toDouble () const
 
frac_t toFrac () const
 
int getNumerator () const
 
int getDenominator () const
 
bool isOne () const
 
void debugPrint (int debuglevel=0, const char *caption="Rational:") const
 

Detailed Description

A simple rational class that holds fractions.


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