public final class DataSizeRoundingUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DIVIDE_BY_8_SHIFT_BITS
The number of bits to shift for dividing by 8.
|
static int |
ROUND_8_MASK_INT
The mask for rounding an integer to a multiple of 8.
|
static long |
ROUND_8_MASK_LONG
The mask for rounding a long integer to a multiple of 8.
|
Modifier and Type | Method and Description |
---|---|
static int |
divideBy8Ceil(int input)
A fast way to compute Math.ceil(input / 8.0).
|
static long |
divideBy8Ceil(long input)
A fast way to compute Math.ceil(input / 8.0).
|
static int |
roundDownTo8Multiple(int input)
Round down the number to the nearest multiple of 8.
|
static long |
roundDownTo8Multiple(long input)
Round down the number to the nearest multiple of 8.
|
static int |
roundUpTo8Multiple(int input)
Round up the number to the nearest multiple of 8.
|
static long |
roundUpTo8Multiple(long input)
Round up the number to the nearest multiple of 8.
|
public static int ROUND_8_MASK_INT
public static long ROUND_8_MASK_LONG
public static int DIVIDE_BY_8_SHIFT_BITS
public static int roundUpTo8Multiple(int input)
input
- the number to round.public static long roundUpTo8Multiple(long input)
input
- the number to round.public static int roundDownTo8Multiple(int input)
input
- the number to round.public static long roundDownTo8Multiple(long input)
input
- the number to round.public static int divideBy8Ceil(int input)
input
- the input number.public static long divideBy8Ceil(long input)
input
- the input number.Copyright © 2024 The Apache Software Foundation. All rights reserved.