- java.lang.Object
-
- com.appslandia.common.utils.MathUtils
-
-
Constructor Summary
Constructors Constructor Description MathUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intceil(int n, int base)static booleanisPow2(long n)static <T> Tmax(T a, T b, Comparator<T> comparator)static <T> Tmin(T a, T b, Comparator<T> comparator)static byte[]toByteArray(int value)static byte[]toByteArray(int begin, int end)static byte[]toByteArray(long value)static inttoInt(byte[] bytes)static longtoLong(byte[] bytes)
-
-
-
Method Detail
-
isPow2
public static boolean isPow2(long n)
-
ceil
public static int ceil(int n, int base)
-
toByteArray
public static byte[] toByteArray(int value)
-
toInt
public static int toInt(byte[] bytes)
-
toByteArray
public static byte[] toByteArray(long value)
-
toLong
public static long toLong(byte[] bytes)
-
toByteArray
public static byte[] toByteArray(int begin, int end)
-
min
public static <T> T min(T a, T b, Comparator<T> comparator)
-
max
public static <T> T max(T a, T b, Comparator<T> comparator)
-
-