ach.types
Class Rational

java.lang.Object
  extended byach.types.Rational

public class Rational
extends java.lang.Object

Class representing a rational number wher a numerator is to be divided by a denominator.


Field Summary
 int denominator
          The denominator of a rational number
 int numerator
          The numerator of a rational number
 
Constructor Summary
Rational(int numerator, int denominator)
          Constructs a rational number
 
Method Summary
 double toDouble()
          Convert a rational number into a double
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numerator

public int numerator
The numerator of a rational number


denominator

public int denominator
The denominator of a rational number

Constructor Detail

Rational

public Rational(int numerator,
                int denominator)
Constructs a rational number

Method Detail

toDouble

public double toDouble()
Convert a rational number into a double