All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prolog.math.Numeric

java.lang.Object
   |
   +----prolog.Term
           |
           +----prolog.math.Numeric

public abstract class Numeric
extends Term
Maths package for Prolog. A stripped and modified version of the gnu.math library, which has the following copyright:

Copyright (c) 1997 Per M.A. Bothner. This is free software; for terms and warranty disclaimer see ./COPYING.

This is the base class of all the other number types.


Variable Index

 o CEILING
 o FLOOR
 o ROUND
 o TRUNCATE

Constructor Index

 o Numeric()

Method Index

 o abs()
 o add(Numeric)
Return this + k * obj.
 o asin()
 o byteValue()
 o compare(Numeric)
Return 1 if this>obj; 0 if this==obj; -1 if this<obj; -2 if either is NaN; -3 if not comparable (not equal).
 o displayString()
Returns a displayable version of this object, for use by write/1.
 o div(Numeric)
 o doubleValue()
 o equals(Object)
 o exp()
 o floatValue()
 o hashCode()
Every Numeric subclass must provide a hashCode method such that numbers that are equal return the same hash.
 o identical(Term)
Asserts that this Term is identical to that.
 o instantiate(Term[])
Copies this term, instantiating variables from the insts array.
 o intValue()
 o isNegative()
 o log()
 o longValue()
 o mod(Numeric)
 o mul(Numeric)
 o neg()
 o shortValue()
 o sin()
 o sqrt()
 o sub(Numeric)
 o toInt(int)
 o toString()
Returns a representation of this object that may be used for debugging or database listings, etc.
 o toString(int)
 o unify(Term, Term[], Prolog)
Unifies this term with the argument.

Variables

 o FLOOR
 public static final int FLOOR
 o CEILING
 public static final int CEILING
 o TRUNCATE
 public static final int TRUNCATE
 o ROUND
 public static final int ROUND

Constructors

 o Numeric
 public Numeric()

Methods

 o instantiate
 public Term instantiate(Term insts[])
Copies this term, instantiating variables from the insts array.

Overrides:
instantiate in class Term
 o unify
 public boolean unify(Term t,
                      Term insts[],
                      Prolog p)
Unifies this term with the argument.

Overrides:
unify in class Term
 o identical
 public boolean identical(Term t)
Asserts that this Term is identical to that.

Overrides:
identical in class Term
 o displayString
 public String displayString()
Returns a displayable version of this object, for use by write/1.

Overrides:
displayString in class Term
 o byteValue
 public byte byteValue()
 o doubleValue
 public abstract double doubleValue()
 o floatValue
 public float floatValue()
 o intValue
 public int intValue()
 o longValue
 public long longValue()
 o shortValue
 public short shortValue()
 o add
 public abstract Numeric add(Numeric n)
Return this + k * obj.

 o sub
 public abstract Numeric sub(Numeric n)
 o mul
 public abstract Numeric mul(Numeric n)
 o div
 public abstract Numeric div(Numeric n)
 o mod
 public abstract Numeric mod(Numeric n)
 o neg
 public abstract Numeric neg()
 o isNegative
 public abstract boolean isNegative()
 o toString
 public abstract String toString(int radix)
 o toString
 public String toString()
Returns a representation of this object that may be used for debugging or database listings, etc.

Overrides:
toString in class Term
 o compare
 public abstract int compare(Numeric n)
Return 1 if this>obj; 0 if this==obj; -1 if this<obj; -2 if either is NaN; -3 if not comparable (not equal).

 o equals
 public boolean equals(Object obj)
Overrides:
equals in class Object
 o abs
 public Numeric abs()
 o toInt
 public Numeric toInt(int rounding_mode)
 o exp
 public FloNum exp()
 o log
 public FloNum log()
 o sin
 public final FloNum sin()
 o asin
 public final FloNum asin()
 o sqrt
 public final FloNum sqrt()
 o hashCode
 public abstract int hashCode()
Every Numeric subclass must provide a hashCode method such that numbers that are equal return the same hash.

Overrides:
hashCode in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index