Package growthbook.sdk.java.util
Class MathUtils
java.lang.Object
growthbook.sdk.java.util.MathUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic float
clamp
(float value, float lowerRange, float upperRange) Given a value, ensures it's clamped between the range providedstatic long
fnv1a_32
(byte[] data) Fowler-Noll-Vo algorithm fnv32a returns a long, so we convert that to a float using a modulusstatic float
Add up all the numbers
-
Constructor Details
-
MathUtils
public MathUtils()
-
-
Method Details
-
fnv1a_32
public static long fnv1a_32(byte[] data) Fowler-Noll-Vo algorithm fnv32a returns a long, so we convert that to a float using a modulus- Parameters:
data
- byte list- Returns:
- long
-
clamp
public static float clamp(float value, float lowerRange, float upperRange) Given a value, ensures it's clamped between the range provided- Parameters:
value
- The number you want to make sure is between lowerRange and upperRangelowerRange
- The lowest valueupperRange
- The highest value- Returns:
- the clamped number
-
sum
Add up all the numbers- Parameters:
items
- Numbers to add- Returns:
- total
-