Fraction implements a mathematical fraction
More...
#include <fraction.h>
Inheritance diagram for Fraction:

Public Member Functions | |
| CASObject * | Absolute () const |
| Returns the absolute value of the fraction. | |
| void | AbsoluteIP () |
| Makes the fraction absolute in-place. | |
| CASObject * | Add (const CASObject *addend) const |
Mathematically adds another CASObject to the fraction. | |
| CASObject * | Clone () const |
| Clones the object. | |
| CASObject * | Divide (const CASObject *divisor) const |
Mathematically divides the fraction by another CASObject. | |
| CASObject * | Evaluate () const |
| Evaluates the fraction. | |
| Fraction (const Fraction &f) | |
| Copy constructor. | |
| Fraction (const CASObject *denom) | |
| Constructor. | |
| Fraction (const CASObject *num, const CASObject *denom) | |
| Constructor. | |
| Fraction () | |
| Constructor. | |
| CASObject * | GCD (const CASObject *o) const |
Calculates the gcd for the fraction and another CASObject. | |
| void | Get (char *s, unsigned long size) const |
| Returns the string representation of the fraction. | |
| void | Get (std::string &s) const |
| Returns the string representation of the fraction. | |
| CASType | GetType () const |
| Returns the type of the object. | |
| CASObject * | Invert () const |
| Inverts the fraction. | |
| void | InvertIP () |
| Inverts the fraction in-place. | |
| bool | IsEqual (const CASObject *o) const |
Compares the fraction and another CASObject for equality. | |
| bool | IsGT (const CASObject *o) const |
Compares whether or not the fraction is greater than another CASObject. | |
| bool | IsLT (const CASObject *o) const |
Compares whether or not the fraction is less than another CASObject. | |
| bool | IsOne () const |
| Indicates whether or not the fraction is one. | |
| bool | IsPureNumerical () const |
| Indicates whether or not the fraction is pure numerical. | |
| bool | IsSimilar (const CASObject *o) const |
Indicates whether or not a CASObject is similar to the fraction. | |
| bool | IsZero () const |
| Indicates whether or not the fraction is zero. | |
| unsigned long | Length () const |
| Returns the lenght of the fraction for string representation. | |
| CASObject * | Modulo (const CASObject *divisor) const |
| Calculates the modulus of the fraction. | |
| CASObject * | Multiply (const CASObject *factor) const |
Mathematically multiplies the fraction by another CASObject. | |
| const Fraction & | operator= (const Fraction &f) |
| Assignment operator. | |
| const bool | operator== (const Fraction &f) const |
| Comparison operator. | |
| CASObject * | Power (const CASObject *exp) const |
Raises the fraction to the edp-Power. | |
| void | Print () const |
| Prints the string representation to the stdout. | |
| void | Sort () |
| Sorts the numerator and denominator of the fraction. | |
| CASObject * | SortWeight () const |
| Calculates the sort weight of the fraction. | |
| CASObject * | Subtract (const CASObject *subtrahend) const |
Mathematically subtracts another CASObject from the fraction. | |
| ~Fraction () | |
| Copy constructor. | |
Private Attributes | |
| CASObject * | denominator |
| Holds the denominator. | |
| CASObject * | numerator |
| Holds the numerator. | |
Friends | |
| class | CASConvert |
Fraction implements a mathematical fraction. It does so by having two attributes, numerator and denominator, which are of the type *CASObject. Therefore, it is possible to have any object derived from CASObject assigned to those attributes.
Fraction itself is derived from CASSymbolic.
Definition at line 58 of file fraction.h.
| CASType Fraction::GetType | ( | ) | const [inline, virtual] |
Returns the type of the object which is always CT_FRACTION.
CASType of value CT_FRACTION. Implements CASObject.
Definition at line 110 of file fraction.h.
CASObject* Fraction::denominator [private] |
Holds the denominator of the fraction.
Definition at line 71 of file fraction.h.
CASObject* Fraction::numerator [private] |
Holds the numerator of the fraction.
Definition at line 65 of file fraction.h.
1.4.7