java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.util.MathUtils

public class MathUtils extends Object
  • 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 round
      toMultipleOfThis - 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 round
      aPowerOfTwo - the result will be divisible by this
      Returns:
      the result will be the smallest multiple of aPowerOfTwo that is no smaller than numberToRound