All Packages Class Hierarchy This Package Previous Next Index
Class prolog.math.FloNum
java.lang.Object
|
+----prolog.Term
|
+----prolog.math.Numeric
|
+----prolog.math.FloNum
- public class FloNum
- extends Numeric
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.
FIXME: This is the floating-point class. (double precision).
-
value
-
-
FloNum(double)
-
-
add(Numeric)
- Return this + k * obj.
-
compare(double, double)
-
-
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).
-
div(Numeric)
-
-
doubleValue()
-
-
equals(Object)
-
-
hashCode()
- Every Numeric subclass must provide a hashCode
method such that numbers that are equal return the same hash.
-
isNegative()
-
-
isZero()
-
-
longValue()
-
-
mod(Numeric)
-
-
mul(Numeric)
-
-
neg()
-
-
normalise_copy(Variable[], int, Vector)
- Copy a Term, instantiating variables from the array.
-
power(IntNum)
-
-
sign()
-
-
sub(Numeric)
-
-
toString()
- Returns a representation of this object that may be used for
debugging or database listings, etc.
-
toString(int)
-
-
typify(TypeDictionary, boolean)
- Generate the type tree that describes this Term.
value
double value
FloNum
public FloNum(double value)
normalise_copy
public Term normalise_copy(Variable vars[],
int next_new_var,
Vector new_vars)
- Copy a Term, instantiating variables from the array.
- Overrides:
- normalise_copy in class Term
typify
public void typify(TypeDictionary types,
boolean map)
- Generate the type tree that describes this Term.
- Overrides:
- typify in class Term
doubleValue
public final double doubleValue()
- Overrides:
- doubleValue in class Numeric
longValue
public long longValue()
- Overrides:
- longValue in class Numeric
hashCode
public int hashCode()
- Every Numeric subclass must provide a hashCode
method such that numbers that are equal return the same hash.
- Overrides:
- hashCode in class Numeric
equals
public boolean equals(Object obj)
- Overrides:
- equals in class Numeric
add
public Numeric add(Numeric y)
- Return this + k * obj.
- Overrides:
- add in class Numeric
sub
public Numeric sub(Numeric y)
- Overrides:
- sub in class Numeric
mul
public Numeric mul(Numeric y)
- Overrides:
- mul in class Numeric
div
public Numeric div(Numeric y)
- Overrides:
- div in class Numeric
mod
public Numeric mod(Numeric y)
- Overrides:
- mod in class Numeric
power
public Numeric power(IntNum y)
isNegative
public boolean isNegative()
- Overrides:
- isNegative in class Numeric
neg
public Numeric neg()
- Overrides:
- neg in class Numeric
sign
public int sign()
compare
public static int compare(double x,
double y)
compare
public 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).
- Overrides:
- compare in class Numeric
isZero
public boolean isZero()
toString
public String toString()
- Returns a representation of this object that may be used for
debugging or database listings, etc.
- Overrides:
- toString in class Numeric
toString
public String toString(int radix)
- Overrides:
- toString in class Numeric
All Packages Class Hierarchy This Package Previous Next Index