Package civitas.celestis.math.integer
Class Integers
java.lang.Object
civitas.celestis.math.integer.Integers
Contains utilities related to
BigIntegers.-
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegerclamp(BigInteger val, BigInteger min, BigInteger max) Clamps the provided valuevalto respect the range of[min, max].
-
Method Details
-
clamp
@Nonnull public static BigInteger clamp(@Nonnull BigInteger val, @Nonnull BigInteger min, @Nonnull BigInteger max) Clamps the provided valuevalto respect the range of[min, max].- Parameters:
val- The value of which to clampmin- The minimum allowed value (inclusive)max- The maximum allowed value (inclusive)- Returns:
- The clamped value
-