Class MathUtil

java.lang.Object
org.openjdk.jol.util.MathUtil

public class MathUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    align(int v, int a)
    Aligns the argument to the given alignment.
    static long
    align(long v, int a)
    Aligns the argument to the given alignment.
    static long
    gcd(long a, long b)
     
    static int
    log2p(int x)
     
    static int
    minDiff(int... offs)
     
    static int
    pow2(int power)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MathUtil

      public MathUtil()
  • Method Details

    • log2p

      public static int log2p(int x)
    • minDiff

      public static int minDiff(int... offs)
    • gcd

      public static long gcd(long a, long b)
    • pow2

      public static int pow2(int power)
    • align

      public static int align(int v, int a)
      Aligns the argument to the given alignment. Alignment should be a power of two.
      Parameters:
      v - value to align
      a - alignment, should be power of two
      Returns:
      aligned value
    • align

      public static long align(long v, int a)
      Aligns the argument to the given alignment. Alignment should be a power of two.
      Parameters:
      v - value to align
      a - alignment, should be power of two
      Returns:
      aligned value