public class MathUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
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 . |
public static int div(int numerator, int denominator)
a/b
).numerator
- the numeratordenominator
- the denominatorpublic static int mod(int numerator, int denominator)
a/b
.numerator
- the numeratordenominator
- the denominatorpublic static int divRoundUp(int numerator, int denominator)
numerator
- the numeratordenominator
- the denominatorpublic static int divRound(int numerator, int denominator)
numerator
- the numeratordenominator
- the denominator