Java API by
Zvi Har’El

kaleido
Class Rational

java.lang.Object
  extended by kaleido.Rational

public class Rational
extends Object

Class Rational

Version:
$Id: Rational.java,v 1.75 2007/02/09 20:07:44 rl Exp $
Author:
Zvi Har’El
See Also:
Class source code

Field Summary
(package private)  int denominator
           
(package private)  int numerator
           
(package private) static Rational ZERO
           
 
Constructor Summary
(package private) Rational(double x)
          Find the numerator and the denominator using the Euclidean algorithm.
private Rational(int numerator, int denominator)
          Private Constructor.
 
Method Summary
(package private)  Rational compl()
           
(package private) static double compl(double x)
           
(package private) static int denominator(double x)
           
(package private)  double doubleValue()
           
(package private)  boolean equals(double x)
           
(package private)  boolean equals(int i)
           
(package private)  boolean equals(Rational r)
           
(package private)  boolean isCompl(Rational r)
           
(package private)  boolean isFinite()
           
(package private)  boolean isInteger()
           
(package private) static boolean isInteger(double x)
           
(package private)  boolean isStar()
           
(package private) static boolean isStar(double x)
           
(package private)  boolean isValid()
           
(package private) static int numerator(double x)
           
 String toString()
           
(package private) static String toString(double x)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numerator

int numerator

denominator

int denominator

ZERO

static final Rational ZERO
Constructor Detail

Rational

private Rational(int numerator,
                 int denominator)
Private Constructor.


Rational

Rational(double x)
Find the numerator and the denominator using the Euclidean algorithm. The resulting rational is reduced.

Method Detail

doubleValue

double doubleValue()

compl

Rational compl()

isCompl

boolean isCompl(Rational r)

isInteger

boolean isInteger()

isFinite

boolean isFinite()

isStar

boolean isStar()

isValid

boolean isValid()

equals

boolean equals(Rational r)

equals

boolean equals(int i)

toString

public String toString()
Overrides:
toString in class Object

equals

boolean equals(double x)

compl

static double compl(double x)

numerator

static int numerator(double x)

denominator

static int denominator(double x)

isInteger

static boolean isInteger(double x)

isStar

static boolean isStar(double x)

toString

static String toString(double x)

Java API by
Zvi Har’El

Copyright © Zvi Har’El
$Date: 2007/10/15 13:50:30$