public class SmallDouble extends java.lang.Object implements java.io.Serializable, Real
Modifier and Type | Field and Description |
---|---|
static SmallDouble |
SMALLEST
A SmallDouble representing the smallest possible value SmallDouble can represent
|
Constructor and Description |
---|
SmallDouble(double d)
Creates a SmallDouble representing the same number as a double
|
SmallDouble(double m,
int e)
Creates a SmallDouble representing the same number as m*2^e
|
Modifier and Type | Method and Description |
---|---|
SmallDouble |
add(double d)
Adds this Real to a double
|
SmallDouble |
add(Real r)
Adds this Real to another
|
void |
addip(Real o)
Adds a Real to this Real in place.
|
void |
addproductip(Real o1,
double o2)
Adds the product of a Real and a double to this Real in place.
|
SmallDouble |
divide(double d)
Divides this Real by a double
|
SmallDouble |
divide(Real o)
Divides this Real by another one
|
boolean |
equals(java.lang.Object o) |
boolean |
greaterThan(double r)
Compares this real to a double
|
boolean |
greaterThan(Real r)
Compares this real to another
|
int |
hashCode() |
SmallDouble |
inverse()
Returns the inverse of this real (i.e.
|
double |
ln()
Returns the natural logarithm of this Real
|
double |
ln1m()
Returns the natural logithm of one minus the value of this Real
|
SmallDouble |
multiply(double d)
Multiplies this Real by a double
|
SmallDouble |
multiply(Real r)
Multiplies this Real by another
|
void |
multiplyip(double d)
Multiplies this Real by a double in place.
|
void |
multiplyip(Real o)
Multiplies this Real by another Real in place.
|
SmallDouble |
negate()
Negates this real.
|
SmallDouble |
subtract(double d)
Subtracts a double from this Real
|
SmallDouble |
subtract(Real o)
Subtracts another Real from this one
|
double |
toDouble()
Returns this real as a double.
|
SmallDouble |
toSmallDouble()
Returns this real as a SmallDouble
|
java.lang.String |
toString() |
public static final SmallDouble SMALLEST
public SmallDouble(double d)
d
- The double to be representedpublic SmallDouble(double m, int e)
m
- me
- epublic SmallDouble multiply(Real r)
Real
public SmallDouble multiply(double d)
Real
public SmallDouble add(Real r)
Real
public SmallDouble add(double d)
Real
public double ln()
Real
public double ln1m()
Real
public boolean greaterThan(Real r)
Real
greaterThan
in interface Real
r
- The other realpublic boolean greaterThan(double r)
Real
greaterThan
in interface Real
r
- The doublepublic SmallDouble subtract(Real o)
Real
public SmallDouble subtract(double d)
Real
public SmallDouble negate()
Real
public SmallDouble inverse()
Real
public SmallDouble divide(Real o)
Real
public SmallDouble divide(double d)
Real
public double toDouble()
Real
public java.lang.String toString()
toString
in class java.lang.Object
public SmallDouble toSmallDouble()
Real
toSmallDouble
in interface Real
public void addip(Real o)
Real
public void multiplyip(Real o)
Real
multiplyip
in interface Real
o
- The real to multiply by.public void multiplyip(double d)
Real
multiplyip
in interface Real
d
- The double to multiply by.public void addproductip(Real o1, double o2)
Real
addproductip
in interface Real
o1
- The real to be be used in the product.o2
- The double to be used in the product.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object