Class MathUtils
- java.lang.Object
-
- com.realtime.crossfire.jxclient.util.MathUtils
-
public class MathUtils extends java.lang.ObjectUtility class for mathematical functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdiv(int numerator, int denominator)Calculates \floor(a/b).static intdivRound(int numerator, int denominator)Returns the quotient of two values, rounded to the nearest integer.static intdivRoundUp(int numerator, int denominator)Returns the quotient of two values, rounded up to the nearest integer.static intmod(int numerator, int denominator)Calculates the remainder ofa/b.
-
-
-
Method Detail
-
div
public static int div(int numerator, int denominator)Calculates \floor(a/b).- Parameters:
numerator- the numeratordenominator- the denominator- Returns:
- the quotient
-
mod
public static int mod(int numerator, int denominator)Calculates the remainder ofa/b.- Parameters:
numerator- the numeratordenominator- the denominator- Returns:
- the quotient
-
divRoundUp
public static int divRoundUp(int numerator, int denominator)Returns the quotient of two values, rounded up to the nearest integer.- Parameters:
numerator- the numeratordenominator- the denominator- Returns:
- the quotient
-
divRound
public static int divRound(int numerator, int denominator)Returns the quotient of two values, rounded to the nearest integer.- Parameters:
numerator- the numeratordenominator- the denominator- Returns:
- the quotient
-
-