Class MathUtils

java.lang.Object
org.github.jamm.utils.MathUtils

public final class MathUtils extends Object
  • Method Details

    • roundTo

      public static long roundTo(long x, int m)
      Rounds x up to the next multiple of m.
      Parameters:
      x - the number to round
      m - the multiple (must be a power of 2)
      Returns:
      the rounded value of x up to the next multiple of m.
    • roundTo

      public static int roundTo(int x, int m)
      Rounds x up to the next multiple of m.
      Parameters:
      x - the number to round
      m - the multiple (must be a power of 2)
      Returns:
      the rounded value of x up to the next multiple of m.