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.
-
CEILING
-
-
FLOOR
-
-
ROUND
-
-
TRUNCATE
-
-
Numeric()
-
-
abs()
-
-
add(Numeric)
- Return this + k * obj.
-
asin()
-
-
byteValue()
-
-
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).
-
displayString()
- Returns a displayable version of this object, for use by
write/1.
-
div(Numeric)
-
-
doubleValue()
-
-
equals(Object)
-
-
exp()
-
-
floatValue()
-
-
hashCode()
- Every Numeric subclass must provide a hashCode
method such that numbers that are equal return the same hash.
-
identical(Term)
- Asserts that this Term is identical to that.
-
instantiate(Term[])
- Copies this term, instantiating variables from the
insts
array.
-
intValue()
-
-
isNegative()
-
-
log()
-
-
longValue()
-
-
mod(Numeric)
-
-
mul(Numeric)
-
-
neg()
-
-
shortValue()
-
-
sin()
-
-
sqrt()
-
-
sub(Numeric)
-
-
toInt(int)
-
-
toString()
- Returns a representation of this object that may be used for
debugging or database listings, etc.
-
toString(int)
-
-
unify(Term, Term[], Prolog)
- Unifies this term with the argument.
FLOOR
public static final int FLOOR
CEILING
public static final int CEILING
TRUNCATE
public static final int TRUNCATE
ROUND
public static final int ROUND
Numeric
public Numeric()
instantiate
public Term instantiate(Term insts[])
- Copies this term, instantiating variables from the
insts
array.
- Overrides:
- instantiate in class Term
unify
public boolean unify(Term t,
Term insts[],
Prolog p)
- Unifies this term with the argument.
- Overrides:
- unify in class Term
identical
public boolean identical(Term t)
- Asserts that this Term is identical to that.
- Overrides:
- identical in class Term
displayString
public String displayString()
- Returns a displayable version of this object, for use by
write/1.
- Overrides:
- displayString in class Term
byteValue
public byte byteValue()
doubleValue
public abstract double doubleValue()
floatValue
public float floatValue()
intValue
public int intValue()
longValue
public long longValue()
shortValue
public short shortValue()
add
public abstract Numeric add(Numeric n)
- Return this + k * obj.
sub
public abstract Numeric sub(Numeric n)
mul
public abstract Numeric mul(Numeric n)
div
public abstract Numeric div(Numeric n)
mod
public abstract Numeric mod(Numeric n)
neg
public abstract Numeric neg()
isNegative
public abstract boolean isNegative()
toString
public abstract String toString(int radix)
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
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).
equals
public boolean equals(Object obj)
- Overrides:
- equals in class Object
abs
public Numeric abs()
toInt
public Numeric toInt(int rounding_mode)
exp
public FloNum exp()
log
public FloNum log()
sin
public final FloNum sin()
asin
public final FloNum asin()
sqrt
public final FloNum sqrt()
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