|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twelvemonkeys.lang.MathUtil
public final class MathUtil
The class MathUtil contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions.
| Method Summary | |
|---|---|
static int |
abs(int pNumber)
A replacement for Math.abs, that never returns negative values. |
static long |
abs(long pNumber)
A replacement for Math.abs, that never returns negative values. |
static double |
ln(double pArg)
Returns the natural logarithm (base e) of a double value. |
static double |
log(double pArg)
Returns the base 10 logarithm of a double value. |
static double |
log(double pArg,
double pBase)
Returns the base N logarithm of a double value, for a given base N. |
static double |
log2(double pArg)
Returns the base 2 logarithm of a double value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double ln(double pArg)
java.lang.Math.log, just with a proper name.
pArg - a number greater than 0.0.
pArg, the natural logarithm of
pArg.Math.log(double)public static double log(double pArg)
pArg - a number greater than 0.0.
pArg, the base 10 logarithm of
pArg.public static double log2(double pArg)
pArg - a number greater than 0.0.
pArg, the base 2
logarithm of pArg.
public static double log(double pArg,
double pBase)
pArg - a number greater than 0.0.pBase - a number greater than 0.0.
pArg, the base
pBase logarithm of pArg.public static long abs(long pNumber)
Math.abs, that never returns negative values.
Math.abs(long) does this for Long.MIN_VALUE.
pNumber - a number
pNumber
ArithmeticException - if pNumber == Long.MIN_VALUEMath.abs(long),
Long.MIN_VALUEpublic static int abs(int pNumber)
Math.abs, that never returns negative values.
Math.abs(int) does this for Integer.MIN_VALUE.
pNumber - a number
pNumber
ArithmeticException - if pNumber == Integer.MIN_VALUEMath.abs(int),
Integer.MIN_VALUE
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||