Class MathUtil
java.lang.Object
org.openjdk.jol.util.MathUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intalign(int v, int a) Aligns the argument to the given alignment.static longalign(long v, int a) Aligns the argument to the given alignment.static longgcd(long a, long b) static intlog2p(int x) static intminDiff(int... offs) static intpow2(int power)
-
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 aligna- 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 aligna- alignment, should be power of two- Returns:
- aligned value
-