Class MathUtils

java.lang.Object
com.sk89q.worldguard.util.MathUtils

public final class MathUtils extends Object
Math-related utilities.
  • Method Details

    • checkedMultiply

      public static long checkedMultiply(long a, long b)
      Returns the product of a and b, provided it does not overflow.

      Borrowed from Google Guava since Bukkit uses an old version.

      Throws:
      ArithmeticException - if a * b overflows in signed long arithmetic