Class MathHelper

java.lang.Object
com.soulfiremc.server.util.MathHelper

public final class MathHelper extends Object
  • Method Details

    • haveSameSign

      public static boolean haveSameSign(double a, double b)
    • isOutsideTolerance

      public static boolean isOutsideTolerance(double a, double b, double tolerance)
    • sumCapOverflow

      public static int sumCapOverflow(int a, int b)
      Sums two integers, returning Integer.MAX_VALUE if the sum overflows.
      Parameters:
      a - The first integer to sum
      b - The second integer to sum
      Returns:
      The sum of the two integers, or Integer.MAX_VALUE if the sum overflows
    • sumCapOverflow

      public static int sumCapOverflow(IntStream stream)
      Sums the values of the stream, returning Integer.MAX_VALUE if the sum overflows.
      Parameters:
      stream - The stream to sum
      Returns:
      The sum of the stream, or Integer.MAX_VALUE if the sum overflows
    • wrapDegrees

      public static float wrapDegrees(float value)