Class MathUtils
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.util.MathUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
roundUpToNearestMultiple(int numberToRound, int toMultipleOfThis)
Rounds the one number up to the nearest multiple of anotherstatic int
roundUpToNearestMultipleOfPowerOfTwo(int numberToRound, int aPowerOfTwo)
Rounds the one number up to the nearest multiple of another, where the second number is a power of two.
-
Constructor Details
-
MathUtils
public MathUtils()
-
-
Method Details
-
roundUpToNearestMultiple
public static int roundUpToNearestMultiple(int numberToRound, int toMultipleOfThis)Rounds the one number up to the nearest multiple of another- Parameters:
numberToRound
- number to roundtoMultipleOfThis
- the result will be divisible by this number- Returns:
- the result will be the smallest multiple of toMultipleOfThis that is no smaller than numberToRound
-
roundUpToNearestMultipleOfPowerOfTwo
public static int roundUpToNearestMultipleOfPowerOfTwo(int numberToRound, int aPowerOfTwo)Rounds the one number up to the nearest multiple of another, where the second number is a power of two.- Parameters:
numberToRound
- number to roundaPowerOfTwo
- the result will be divisible by this- Returns:
- the result will be the smallest multiple of aPowerOfTwo that is no smaller than numberToRound
-