public final class MathUtils
extends java.lang.Object
Math
or Google Guava.| Modifier and Type | Method and Description |
|---|---|
static float |
average(java.util.Collection<? extends java.lang.Number> numbers) |
static int |
ceiling(float n) |
static int |
clamp(int value,
int min,
int max) |
static long |
clamp(long value,
long min,
long max) |
static float |
getAspectRatio(int width,
int height) |
static float |
getAspectRatio(Rect r) |
static boolean |
isPowerOfTwo(int n) |
static int |
nextPowerOfTwo(int n) |
static int |
signum(float n) |
static int |
signum(int n) |
static int |
sum(int[] values) |
public static int ceiling(float n)
public static int signum(int n)
public static int signum(float n)
public static int sum(int[] values)
public static int clamp(int value,
int min,
int max)
public static long clamp(long value,
long min,
long max)
public static float average(java.util.Collection<? extends java.lang.Number> numbers)
public static boolean isPowerOfTwo(int n)
public static int nextPowerOfTwo(int n)
public static float getAspectRatio(int width,
int height)
public static float getAspectRatio(Rect r)