public class Rationals extends Group implements FieldI, OrderedSetI, HasPowerI
Constructor and Description |
---|
Rationals() |
Modifier and Type | Method and Description |
---|---|
Number |
add(Number a,
Number b)
Get sum of the numbers
|
int |
compare(Number a,
Number b)
Returns -1,0,1 depending on whether a is less than, equal to or greater than b.
|
Number |
div(Number a,
Number b)
get division of two numbers.
|
boolean |
equals(Number a,
Number b)
whether two numbers are equal
|
Number |
getInverse(Number num)
Get Inverse of a number
|
Number |
getMulInverse(Number num)
get mul inverse
|
Number |
getONE()
Get multiplicative identity i.e.
|
Number |
getZERO()
Returns the identity element under +
|
Number |
mul(Number a,
Number b)
Returns the product of two numbers, a*b
|
Number |
pow(Number a,
Number b) |
Number |
sub(Number a,
Number b)
Get the difference of the numbers.
|
String |
toString() |
Number |
valueOf(String s)
returns number given by the string
|
addStandardConstants, addStandardFunctions, getNumberFactory, isConstantPoly
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStandardConstants, addStandardFunctions, getNumberFactory, isConstantPoly
public Number getZERO()
GroupI
public Number getONE()
RingI
public Number getInverse(Number num)
GroupI
getInverse
in interface GroupI
public Number getMulInverse(Number num)
FieldI
getMulInverse
in interface FieldI
public Number add(Number a, Number b)
GroupI
public Number sub(Number a, Number b)
GroupI
public Number mul(Number a, Number b)
RingI
public Number div(Number a, Number b)
HasDivI
public boolean equals(Number a, Number b)
GroupI
public int compare(Number a, Number b)
OrderedSetI
compare
in interface OrderedSetI
public Number valueOf(String s)
GroupI
Jas4pp 1.5 © Java Analysis Studio for Particle Physics