java.lang.Object com.realtime.crossfire.jxclient.util.MathUtils
public class MathUtils
Utility class for mathematical functions.
Constructor Summary | |
---|---|
private |
MathUtils()
Private constructor to prevent instantiation. |
Method Summary | |
---|---|
static int |
div(int numerator,
int denominator)
Calculates \floor( a/b ). |
static int |
divRound(int numerator,
int denominator)
Returns the quotient of two values, rounded to the nearest integer. |
static int |
divRoundUp(int numerator,
int denominator)
Returns the quotient of two values, rounded up to the nearest integer. |
static int |
mod(int numerator,
int denominator)
Calculates the remainder of a/b . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private MathUtils()
Method Detail |
---|
public static int div(int numerator, int denominator)
a/b
).
numerator
- the numeratordenominator
- the denominator
public static int divRound(int numerator, int denominator)
numerator
- the numeratordenominator
- the denominator
public static int divRoundUp(int numerator, int denominator)
numerator
- the numeratordenominator
- the denominator
public static int mod(int numerator, int denominator)
a/b
.
numerator
- the numeratordenominator
- the denominator