public class MathUtil
extends java.lang.Object
Constructor and Description |
---|
MathUtil() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static int parseDigit(char digit)
public static long randomLong(long min, long max)
min
- lower (inclusive) boundarymax
- higher (exclusive) boundarypublic static int randomInt(int min, int max)
min
- lower (inclusive) boundarymax
- higher (exclusive) boundarypublic 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)
Copyright © 2003-present Jodd Team