atlas  0.6
Public Member Functions | Private Attributes | List of all members
atlas::arithmetic::Rational Class Reference

#include <arithmetic.h>

Public Member Functions

 Rational (Numer_t n=0, Denom_t d=1)
 
Numer_t numerator () const
 
Numer_t denominator () const
 
Rational operator+ (Rational q) const
 
Rational operator- (Rational q) const
 
Rational operator* (Rational q) const
 
Rational operator/ (Rational q) const
 
Rational operator% (Rational q) const
 
Rationaloperator= (Rational q)
 
Rationaloperator+= (Rational q)
 
Rationaloperator-= (Rational q)
 
Rationaloperator*= (Rational q)
 
Rationaloperator/= (Rational q)
 
Rationaloperator%= (Rational q)
 
Rationaloperator+= (Numer_t n)
 
Rationaloperator-= (Numer_t n)
 
Rationaloperator*= (Numer_t n)
 
Rationaloperator/= (Numer_t n)
 
Rationaloperator%= (Numer_t n)
 
bool operator== (Rational q) const
 
bool operator!= (Rational q) const
 
bool operator< (Rational q) const
 
bool operator<= (Rational q) const
 
bool operator> (Rational q) const
 
bool operator>= (Rational q) const
 
Rationalnormalize ()
 
Rationalpower (int n)
 

Private Attributes

Numer_t num
 
Denom_t denom
 

Constructor & Destructor Documentation

atlas::arithmetic::Rational::Rational ( Numer_t  n = 0,
Denom_t  d = 1 
)
inlineexplicit

Member Function Documentation

Numer_t atlas::arithmetic::Rational::denominator ( ) const
inline
Rational & atlas::arithmetic::Rational::normalize ( )
inline
Numer_t atlas::arithmetic::Rational::numerator ( ) const
inline
bool atlas::arithmetic::Rational::operator!= ( Rational  q) const
inline
bool atlas::arithmetic::Rational::operator<= ( Rational  q) const
inline
bool atlas::arithmetic::Rational::operator== ( Rational  q) const
inline
bool atlas::arithmetic::Rational::operator>= ( Rational  q) const
inline
Rational & atlas::arithmetic::Rational::power ( int  n)

Member Data Documentation

Denom_t atlas::arithmetic::Rational::denom
private
Numer_t atlas::arithmetic::Rational::num
private

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