FileDocCategorySizeDatePackage
TestMyRationalC.javaAPI DocExample621Fri Oct 01 15:10:28 BST 1999None

TestMyRationalC

public class TestMyRationalC extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    int n = 5;
    int d = 10;
    MyRationalC r = new MyRationalC(5, 10);

    int g = r.gcd(n, d);
    System.out.println("gcd: " + g);

    float f = r.toReal();
    System.out.println("real value: " + f);

    MyRationalC s = r.plus(r); 
    System.out.println("sum: " + s);

    s.normalize();
    System.out.println("sum: " + s);