public class MathUtils extends Object
| 构造器和说明 |
|---|
MathUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
log2strict(int value)
Computes the logarithm of the given value to the base of 2.
|
static int |
roundDownToPowerOf2(int value)
Decrements the given number down to the closest power of two.
|
public static int roundDownToPowerOf2(int value)
value - The value to round down.public static int log2strict(int value)
throws ArithmeticException,
IllegalArgumentException
value - The value to compute the logarithm for.ArithmeticException - Thrown, if the given value is zero.IllegalArgumentException - Thrown, if the given value is not a power of two.Copyright © 2023 The Apache Software Foundation. All rights reserved.