Class MathHelper


  • public final class MathHelper
    extends Object
    • Method Detail

      • ceilingPowerOfTwo

        public static int ceilingPowerOfTwo​(int value)
        Returns the smallest power of two number that is greater than or equal to value.
        Parameters:
        value - reference number
        Returns:
        smallest power of two number
      • divideRoundingUp

        public static int divideRoundingUp​(int numerator,
                                           int denominator)
        Returns the result of dividing a positive numerator by a positive denominator rounded up.

        For example dividing 5 by 2 ist 2.5, which (when rounded up) gives a result of 3.