Package org.hibernate.internal.util
Class MathHelper
java.lang.Object
org.hibernate.internal.util.MathHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
ceilingPowerOfTwo
(int value) Returns the smallest power of two number that is greater than or equal tovalue
.static int
divideRoundingUp
(int numerator, int denominator) Returns the result of dividing a positivenumerator
by a positivedenominator
rounded up.
-
Method Details
-
ceilingPowerOfTwo
public static int ceilingPowerOfTwo(int value) Returns the smallest power of two number that is greater than or equal tovalue
.- Parameters:
value
- reference number- Returns:
- smallest power of two number
-
divideRoundingUp
public static int divideRoundingUp(int numerator, int denominator) Returns the result of dividing a positivenumerator
by a positivedenominator
rounded up.For example dividing 5 by 2 ist 2.5, which (when rounded up) gives a result of 3.
-