|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.util.FixedPointLong
Implements fixed-point numbers in the long primitive type
| Constructor Summary | |
FixedPointLong()
|
|
| Method Summary | |
static long |
cos(long degreesFlong)
returns the cosine of a flong, as a flong |
static long |
div(long topFlong,
long bottomFlong)
returns a flong representing the division of the parameter flongs |
static java.lang.String |
flongToString(long l)
Makes a string from a flong, to the full precision available |
static java.lang.String |
flongToString(long l,
int dp)
Makes a string from a flong, with precisely the specified number of decimal places |
static long |
fracPart(long flong)
returns a flong representing the fractional portion of the parameter flong |
static long |
intPart(long flong)
returns a flong representing the integer portion of the parameter flong |
static long |
intToFlong(int i)
make a flong from an integer |
static long |
intToFlongSafe(int i)
make a flong from an int, but without checking for overflow -- use this only on constants |
static int |
intValue(long flong)
returns the integer value, after rounding, of the flong |
static long |
intValueRounded(long flong)
rounded to the nearest integer |
static long |
mult(long flongOne,
long flongTwo)
Returns a flong representing the multiple of the two parameter flongs |
static long |
pythagoras(long x,
long y)
returns a flong representing sqrt(x*x+y*y), where x and y are the parameter flongs. |
static long |
sqrt(long flong)
returns the flong representing the positive square root of a flong |
static long |
square(long flong)
returns the flong representing the square of the parameter flong |
static long |
stringToFlong(java.lang.String s)
make a flong from a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FixedPointLong()
| Method Detail |
public static final long intToFlongSafe(int i)
public static final long intToFlong(int i)
throws FixedPointLongException
FixedPointLongException - if an overflow occurs
public static final long stringToFlong(java.lang.String s)
throws FixedPointLongException
FixedPointLongException - if the string is not parseable, or if overflow occurs
public static final java.lang.String flongToString(long l)
throws FixedPointLongException
FixedPointLongException
public static final java.lang.String flongToString(long l,
int dp)
throws FixedPointLongException
FixedPointLongExceptionpublic static final long intPart(long flong)
public static final long fracPart(long flong)
public static final int intValue(long flong)
public static final long cos(long degreesFlong)
public static final long div(long topFlong,
long bottomFlong)
throws FixedPointLongException
FixedPointLongException - if a divide-by-zero occurs
public static long mult(long flongOne,
long flongTwo)
throws FixedPointLongException
FixedPointLongException - if overflow occurs
public static long square(long flong)
throws FixedPointLongException
FixedPointLongException - if overflow occurs
public static long sqrt(long flong)
throws FixedPointLongException
FixedPointLongException - if a negative number is passed in
public static long pythagoras(long x,
long y)
throws FixedPointLongException
FixedPointLongExceptionpublic static long intValueRounded(long flong)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||