## Class Rational

    java.lang.Object
      Rational

public class Rational
extends java.lang.Object

This class implements a rational number object, and provides methods for performing arithmetic on rational numbers.

Version:
  3.14159
Author:
  Schultzie von Wienerschnitzel III
See Also:
  `Math`

Constructor Summary
`Rational()` Default constructor creates the rational 0/1.
`Rational(int n, int d)` Standard constructor given numerator and denominator.

Method Summary
`static Rational` `multiply(Rational q, Rational r)` Multiplies two rational numbers and returns their the product.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Rational

    public Rational()

  Default constructor creates the rational 0/1.

### Rational

    public Rational(int n,
                    int d)

  Standard constructor given numerator and denominator.

Parameters:
  `n` - The numerator
  `d` - The denominator

Method Detail

### multiply

    public static Rational multiply(Rational q,
                                    Rational r)

  Multiplies two rational numbers and returns their the product.

  Parameters:
    `q` - The first operand.
    `r` - The second operand.
  Returns:
    A reference to a newly created Rational with the sum.