#include <types.h>
Public Member Functions | |
| Rational () | |
| Build an empty Rational. | |
| Rational (Int32 Num, Int32 Den) | |
| Initialise a Rational with a value. | |
| Int32 | GreatestCommonDivisor (void) |
| Determine the greatest common divisor using the Euclidean algorithm. | |
| void | Reduce (void) |
| Reduce a rational to its lowest integer form. | |
| bool | operator== (const Rational &RHS) |
| Check for exact equality (not just the same ratio). | |
Public Attributes | |
| Int32 | Numerator |
| Numerator of the fraction (top number). | |
| Int32 | Denominator |
| Denominator of the fraction (bottom number). | |
| Int32 GreatestCommonDivisor | ( | void | ) | [inline] |
Determine the greatest common divisor using the Euclidean algorithm.
The larger value for Euclidean algorithm
The smaller value for Euclidean algorithm
| void Reduce | ( | void | ) | [inline] |
Reduce a rational to its lowest integer form.
| bool operator== | ( | const Rational & | RHS | ) | [inline] |
Check for exact equality (not just the same ratio).
Denominator of the fraction (bottom number).
1.5.1-p1