// test for class Rational   ---    1/17/99   ---   rgl
import java.io.*;

public class RationalTest  {
   public static void main(String argv[])  {
      Rational a = new Rational();
      Rational b = new Rational(7);
      Rational c = new Rational(7,3);
      Rational d = new Rational("-1/2");
      Rational e = new Rational("1/5");
      Rational f = new Rational(1.6666666666666666666667);
      Rational g = new Rational(Math.PI);
      Rational h = new Rational(3);
      Rational k1 = new Rational(Math.PI,0.01);
      Rational k2 = new Rational(Math.PI,0.00001);
      Rational k3 = new Rational(Math.PI,0.00000001);
      Rational k4 = new Rational(Math.PI,0.00000000001);
      Rational k5 = new Rational(Math.PI,0.00000000000001);
      Rational l = new Rational(57.0);
      Rational z = new Rational(0);
      System.out.println("0 is "+a);
      System.out.println("7 is "+b);
      System.out.println("7/3 is "+c);
      System.out.println("-1/2 is "+d);
      System.out.println("1/5 is "+e);
      System.out.println("1.6666666666666666666667 is "+f);
      System.out.println("PI is "+g+", more or less");
      System.out.println("   which is "+g.doubleValue());
      System.out.println("PI is "+k1+", more or less");
      System.out.println("   which is "+k1.doubleValue());
      System.out.println("PI is "+k2+", more or less");
      System.out.println("   which is "+k2.doubleValue());
      System.out.println("PI is "+k3+", more or less");
      System.out.println("   which is "+k3.doubleValue());
      System.out.println("PI is "+k4+", more or less");
      System.out.println("   which is "+k4.doubleValue());
      System.out.println("PI is "+k5+", more or less");
      System.out.println("   which is "+k5.doubleValue());
      System.out.println("57.0 is "+l);
      System.out.println("0 is "+z);
      System.out.println("7/3+(-1/2) is "+c.plus(d));
      System.out.println("-1/2-1/5 is "+d.minus(e));
      System.out.println("(-1/2)*(1/5) is "+d.times(e));
      System.out.println("7/(7/3) is "+b.quotient(c));
      System.out.println("7/0 is "+b.quotient(a));
      System.out.println("0.reciprocal() is "+z.reciprocal());
      }
   }
