|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fixbin.light.FixBinNoTrig
FixBin the light version of the FixBin library this class can be used in 2 ways: either the static methods are used or alternatively it can be used to instantiate objects that handle the values (much like the StringBuffer class). Example 1: FixBin myVal = new FixBin("1.234"); myVal.mul(3); System.out.println("Result: " + myVal); Example 2: long myVal = FixBin-toFixBin("1.234"); long val3 = FixBin.toFixBin("3"); myVal = FixBin.mul(myVal, val3); System.out.println("Result: " + FixBin.toString(myVal));
| Field Summary | |
protected static int |
commaBitPos
|
protected static long |
commaBitVal
|
static long |
E
|
static long |
PI
|
static long |
PI2
|
| Constructor Summary | |
protected |
FixBinNoTrig()
create a new instance of FixBin with value 0.0 |
| Method Summary | |
static long |
abs(long val)
Returns the absolute value of a fixbin-encoded val |
static long |
add(long x,
long y)
adds two fixbin-values |
static int |
compareTo(long x,
long y)
Compares two (fixbin-encoded) values and returns 1 if x > y, -1 if x < y, 0 if x == y |
static long |
div(long val1,
long val2)
Divide two fixbin-encoded values |
static long |
exp(long val)
Calculates e^val val should be fixbin encoded |
static java.lang.String |
format(long fixVal,
int decimals)
formats a fixbin-coded value to a String with a given number of figures after the decimal point |
static int |
intValue(long val)
Returns the integer-value of a given fixbin-encoded val |
static long |
ln(long val)
Calculates the natural log of the given fixbin-encoded val |
protected static long |
lngt1(long val)
Calculates the natural log for values > 1 |
protected static long |
lnlt1(long val)
Calculates the natural log for values < 1 |
static long |
longValue(long val)
Returns the long-value of a given fixbin-encoded val |
static long |
mul(long val1,
long val2)
Multiply two fixbin encoded values |
static long |
pow(long x,
int howmany)
Calculates the power of the first parameter by the second. |
static long |
pow(long bas,
long exp)
Calculates the power of the first parameter by the second. |
static long |
sqr(long x)
Calculate the square of the given fixbin-encoded value |
static long |
sqrt(long val)
Calculates the square root of the given fixbin-encoded value |
static long |
sqrt(long val,
int nth)
Calculates the nth root of the given value (val). val should be fixbin-encoded, nth is just an integer value |
static long |
sub(long x,
long y)
Substract two fixbin-coded values |
static long |
toFixBin(int val)
Transform an integer to a FixBin coded long |
static long |
toFixBin(long val)
Transform a long value to a FixBin coded long |
static long |
toFixBin(java.lang.String init)
Transform a String into a fixbin-coded LONG |
static java.lang.String |
toString(long fixVal)
returns the value of the fixbin-coded value as a String |
protected static long |
xbyndivnfact(long x,
int n)
This is a helper method required by other exponential methods it calculates x ^ n / n! |
protected static long |
xmmbyndivnxppbynx2(long x,
int n)
calculates an intermediate value for ln |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int commaBitPos
protected static final long commaBitVal
public static long PI
public static long E
public static long PI2
| Constructor Detail |
protected FixBinNoTrig()
| Method Detail |
public static long toFixBin(java.lang.String init)
init - (String)
public static long toFixBin(int val)
val - (int)
public static long toFixBin(long val)
val - (long)
public static java.lang.String format(long fixVal,
int decimals)
fixVal - (long)decimals - (int)
public static java.lang.String toString(long fixVal)
fixVal - (long)
public static long add(long x,
long y)
x - (long)y - (long)
public static long sub(long x,
long y)
x - (long)y - (long)
public static long mul(long val1,
long val2)
val1 - (long)val2 - (long)
public static long div(long val1,
long val2)
val1 - (long)val2 - (long)
public static long sqr(long x)
x - (long)
public static long pow(long x,
int howmany)
x - (long)howmany - (int)
public static long pow(long bas,
long exp)
throws java.lang.Exception
java.lang.Exception
public static long sqrt(long val)
throws java.lang.Exception
val - (long)
java.lang.Exception
public static long sqrt(long val,
int nth)
throws java.lang.Exception
val - (long)nth - (int)
java.lang.Exception
protected static long xbyndivnfact(long x,
int n)
x - (long)n - (int)
public static long exp(long val)
throws java.lang.Exception
val - (long)
java.lang.Exception
protected static long xmmbyndivnxppbynx2(long x,
int n)
x - (long)n - (int)
protected static long lngt1(long val)
throws java.lang.Exception
val - (long)
java.lang.Exception
protected static long lnlt1(long val)
throws java.lang.Exception
val - (long)
java.lang.Exception
public static long ln(long val)
throws java.lang.Exception
val - (long)
java.lang.Exceptionpublic static int intValue(long val)
val - (long)
public static long longValue(long val)
val - (long)
public static int compareTo(long x,
long y)
x - (long)y - (long)
public static long abs(long val)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||