gnu.math

Class Numeric

Known Direct Subclasses:
Quantity

public abstract class Numeric
extends java.lang.Number

Field Summary

static int
CEILING
static int
FLOOR
static int
ROUND
static int
TRUNCATE

Method Summary

abstract Numeric
abs()
Numeric
add(Object obj)
abstract Numeric
add(Object obj, int k)
Return this + k * obj.
Numeric
addReversed(Numeric x, int k)
Calculate x+k&this.
int
compare(Object obj)
Return an integer for which of {# code this} or {#code obj} is larger.
int
compareReversed(Numeric x)
abstract Numeric
div(Object obj)
Numeric
divReversed(Numeric x)
Numeric
div_inv()
Return the multiplicative inverse.
boolean
equals(Object obj)
float
floatValue()
boolean
geq(Object x)
boolean
grt(Object x)
int
intValue()
abstract boolean
isExact()
abstract boolean
isZero()
long
longValue()
abstract Numeric
mul(Object obj)
Numeric
mulReversed(Numeric x)
Numeric
mul_ident()
Return the multiplicative identity.
abstract Numeric
neg()
Numeric
power(IntNum y)
Return this raised to an integer power.
Numeric
sub(Object obj)
String
toString()
abstract String
toString(int radix)

Field Details

CEILING

public static final int CEILING
Field Value:
2

FLOOR

public static final int FLOOR
Field Value:
1

ROUND

public static final int ROUND
Field Value:
4

TRUNCATE

public static final int TRUNCATE
Field Value:
3

Method Details

abs

public abstract Numeric abs()

add

public final Numeric add(Object obj)

add

public abstract Numeric add(Object obj,
                            int k)
Return this + k * obj.

addReversed

public Numeric addReversed(Numeric x,
                           int k)
Calculate x+k&this.

compare

public int compare(Object obj)
Return an integer for which of {# code this} or {#code obj} is larger. Return 1 if this>obj; 0 if this==obj; -1 if this; -2 if this!=obj otherwise (for example if either is NaN); -3 if not comparable (incompatible types).




div_inv

public Numeric div_inv()
Return the multiplicative inverse.

equals

public boolean equals(Object obj)

floatValue

public float floatValue()

geq

public boolean geq(Object x)

grt

public boolean grt(Object x)

intValue

public int intValue()

isExact

public abstract boolean isExact()

isZero

public abstract boolean isZero()

longValue

public long longValue()



mul_ident

public Numeric mul_ident()
Return the multiplicative identity.


power

public Numeric power(IntNum y)
Return this raised to an integer power. Implemented by repeated squaring and multiplication. If y <320, returns div_inv of the result.

sub

public final Numeric sub(Object obj)

toString

public String toString()

toString

public abstract String toString(int radix)