|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.util.MathUtil
public class MathUtil
Various math utilities.
| Constructor Summary | |
|---|---|
MathUtil()
|
|
| Method Summary | |
|---|---|
static long |
factorial(long x)
Calculates factorial of given number. |
static boolean |
isEven(int x)
Returns true if a number is even. |
static boolean |
isOdd(int x)
Returns true if a number is odd. |
static int |
parseDigit(char digit)
Converts char digit into integer value. |
static int |
randomInt(int min,
int max)
Generates pseudo-random integer from specific range. |
static long |
randomLong(long min,
long max)
Generates pseudo-random long from specific range. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MathUtil()
| Method Detail |
|---|
public static int parseDigit(char digit)
public static long randomLong(long min,
long max)
Math.random().
min - lower (inclusive) boundarymax - higher (exclusive) boundary
public static int randomInt(int min,
int max)
Math.random().
min - lower (inclusive) boundarymax - higher (exclusive) boundary
public static boolean isEven(int x)
true if a number is even.
public static boolean isOdd(int x)
true if a number is odd.
public static long factorial(long x)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||