All Packages Class Hierarchy This Package Previous Next Index
Class prolog.math.IntNum
java.lang.Object
|
+----prolog.Term
|
+----prolog.math.Numeric
|
+----prolog.math.IntNum
- public class IntNum
- 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.
A class for infinite-precision integers.
-
ival
-
-
maxFixNum
-
-
minFixNum
- We pre-allocate integers in the range minFixNum..maxFixNum.
-
numFixNum
-
-
smallFixNums
-
-
IntNum()
-
-
IntNum(int)
- Create a new (non-shared) IntNum, and initialize to an
int.
-
()
-
-
add(IntNum)
-
-
add(Numeric)
- Return this + k * obj.
-
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.
-
intValue()
-
-
isNegative()
- Return the IntNum for -1.
-
longValue()
-
-
make(int)
- Return a (possibly-shared) IntNum with a given int value.
-
mod(Numeric)
-
-
mul(Numeric)
-
-
neg()
-
-
normalise_copy(Variable[], int, Vector)
- Copy a Term, instantiating variables from the array.
-
one()
-
-
sign()
-
-
sub(IntNum)
-
-
sub(Numeric)
-
-
toInt(int)
-
-
toString(int)
-
-
typify(TypeDictionary, boolean)
- Generate the type tree that describes this Term.
ival
public int ival
minFixNum
static final int minFixNum
- We pre-allocate integers in the range minFixNum..maxFixNum.
maxFixNum
static final int maxFixNum
numFixNum
static final int numFixNum
smallFixNums
static final IntNum smallFixNums[]
IntNum
public IntNum()
IntNum
public IntNum(int value)
- Create a new (non-shared) IntNum, and initialize to an
int.
- Parameters:
- value - the initial 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
static void ()
make
public static IntNum make(int value)
- Return a (possibly-shared) IntNum with a given int value.
add
public Numeric add(Numeric y)
- Return this + k * obj.
- Overrides:
- add in class Numeric
add
public IntNum add(IntNum y)
sub
public Numeric sub(Numeric y)
- Overrides:
- sub in class Numeric
sub
public IntNum sub(IntNum y)
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
neg
public Numeric neg()
- Overrides:
- neg in class Numeric
one
public static final IntNum one()
isNegative
public final boolean isNegative()
- Return the IntNum for -1.
- Overrides:
- isNegative in class Numeric
sign
public int sign()
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
toInt
public Numeric toInt(int rounding_mode)
- Overrides:
- toInt in class Numeric
toString
public String toString(int radix)
- Overrides:
- toString in class Numeric
intValue
public int intValue()
- Overrides:
- intValue 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
doubleValue
public double doubleValue()
- Overrides:
- doubleValue in class Numeric
All Packages Class Hierarchy This Package Previous Next Index