Class MathPreconditions

java.lang.Object
com.google.common.math.MathPreconditions

final class MathPreconditions extends Object
A collection of preconditions for math functions.
  • Constructor Details

    • MathPreconditions

      private MathPreconditions()
  • Method Details

    • checkPositive

      static int checkPositive(String role, int x)
    • checkPositive

      static long checkPositive(String role, long x)
    • checkPositive

      static BigInteger checkPositive(String role, BigInteger x)
    • checkNonNegative

      static int checkNonNegative(String role, int x)
    • checkNonNegative

      static long checkNonNegative(String role, long x)
    • checkNonNegative

      static BigInteger checkNonNegative(String role, BigInteger x)
    • checkNonNegative

      static double checkNonNegative(String role, double x)
    • checkRoundingUnnecessary

      static void checkRoundingUnnecessary(boolean condition)
    • checkInRangeForRoundingInputs

      static void checkInRangeForRoundingInputs(boolean condition, double input, RoundingMode mode)
    • checkNoOverflow

      static void checkNoOverflow(boolean condition, String methodName, int a, int b)
    • checkNoOverflow

      static void checkNoOverflow(boolean condition, String methodName, long a, long b)