Package: org.codehaus.groovy.vmplugin.v8

## [Java] Class IndyMath

- org.codehaus.groovy.vmplugin.v8.IndyMath

-     public class IndyMath
      extends Object

  This class contains math operations used by indy instead of the normal meta method and call site caching system. The goal is to avoid boxing, thus use primitive types for parameters and return types where possible. WARNING: This class is for internal use only. Do not use it outside the org.codehaus.groovy.vmplugin.v8 package of groovy-core.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static int` | `and(int a, int b)` Performs a bitwise AND on two `int` values.
    `` | `public static long` | `and(long a, long b)` Performs a bitwise AND on two `long` values.
    `` | `public static boolean` | `chooseMathMethod(Selector info, MetaMethod metaMethod)` Choose a method to replace the originally chosen metaMethod to have a more efficient call path.
    `` | `public static double` | `div(double a, double b)` Divides one `double` value by another.
    `` | `public static int` | `leftShift(int a, int b)` Left-shifts an `int` value.
    `` | `public static long` | `leftShift(long a, long b)` Left-shifts a `long` value.
    `` | `public static int` | `minus(int a, int b)` Subtracts one `int` value from another.
    `` | `public static long` | `minus(long a, long b)` Subtracts one `long` value from another.
    `` | `public static double` | `minus(double a, double b)` Subtracts one `double` value from another.
    `` | `public static int` | `mod(int a, int b)` Returns Groovy's modulo result for two `int` values.
    `` | `public static long` | `mod(long a, long b)` Returns Groovy's modulo result for two `long` values.
    `` | `public static int` | `multiply(int a, int b)` Multiplies two `int` values.
    `` | `public static long` | `multiply(long a, long b)` Multiplies two `long` values.
    `` | `public static double` | `multiply(double a, double b)` Multiplies two `double` values.
    `` | `public static int` | `next(int i)` Returns the successor of an `int` value.
    `` | `public static long` | `next(long l)` Returns the successor of a `long` value.
    `` | `public static double` | `next(double d)` Returns the successor of a `double` value.
    `` | `public static int` | `or(int a, int b)` Performs a bitwise OR on two `int` values.
    `` | `public static long` | `or(long a, long b)` Performs a bitwise OR on two `long` values.
    `` | `public static int` | `plus(int a, int b)` Adds two `int` values.
    `` | `public static long` | `plus(long a, long b)` Adds two `long` values.
    `` | `public static double` | `plus(double a, double b)` Adds two `double` values.
    `` | `public static int` | `previous(int i)` Returns the predecessor of an `int` value.
    `` | `public static long` | `previous(long l)` Returns the predecessor of a `long` value.
    `` | `public static double` | `previous(double d)` Returns the predecessor of a `double` value.
    `` | `public static int` | `remainder(int a, int b)` Returns the remainder of dividing two `int` values.
    `` | `public static long` | `remainder(long a, long b)` Returns the remainder of dividing two `long` values.
    `` | `public static int` | `rightShift(int a, int b)` Right-shifts an `int` value.
    `` | `public static long` | `rightShift(long a, long b)` Right-shifts a `long` value.
    `` | `public static int` | `xor(int a, int b)` Performs a bitwise XOR on two `int` values.
    `` | `public static long` | `xor(long a, long b)` Performs a bitwise XOR on two `long` values.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static int and(int a, int b)

      Performs a bitwise AND on two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise AND result

    - #### public static long and(long a, long b)

      Performs a bitwise AND on two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise AND result

    - #### public static boolean chooseMathMethod(Selector info, MetaMethod metaMethod)

      Choose a method to replace the originally chosen metaMethod to have a more efficient call path.

    - #### public static double div(double a, double b)

      Divides one `double` value by another.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the quotient

    - #### public static int leftShift(int a, int b)

      Left-shifts an `int` value.

      Parameters:
        `a` - the value to shift
        `b` - the shift distance
      Returns:
        the shifted result

    - #### public static long leftShift(long a, long b)

      Left-shifts a `long` value.

      Parameters:
        `a` - the value to shift
        `b` - the shift distance
      Returns:
        the shifted result

    - #### public static int minus(int a, int b)

      Subtracts one `int` value from another.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the difference

    - #### public static long minus(long a, long b)

      Subtracts one `long` value from another.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the difference

    - #### public static double minus(double a, double b)

      Subtracts one `double` value from another.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the difference

    - #### public static int mod(int a, int b)

      Returns Groovy's modulo result for two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the modulo result

    - #### public static long mod(long a, long b)

      Returns Groovy's modulo result for two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the modulo result

    - #### public static int multiply(int a, int b)

      Multiplies two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the product

    - #### public static long multiply(long a, long b)

      Multiplies two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the product

    - #### public static double multiply(double a, double b)

      Multiplies two `double` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the product

    - #### public static int next(int i)

      Returns the successor of an `int` value.

      Parameters:
        `i` - the input value
      Returns:
        `i + 1`

    - #### public static long next(long l)

      Returns the successor of a `long` value.

      Parameters:
        `l` - the input value
      Returns:
        `l + 1`

    - #### public static double next(double d)

      Returns the successor of a `double` value.

      Parameters:
        `d` - the input value
      Returns:
        `d + 1`

    - #### public static int or(int a, int b)

      Performs a bitwise OR on two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise OR result

    - #### public static long or(long a, long b)

      Performs a bitwise OR on two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise OR result

    - #### public static int plus(int a, int b)

      Adds two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the sum

    - #### public static long plus(long a, long b)

      Adds two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the sum

    - #### public static double plus(double a, double b)

      Adds two `double` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the sum

    - #### public static int previous(int i)

      Returns the predecessor of an `int` value.

      Parameters:
        `i` - the input value
      Returns:
        `i - 1`

    - #### public static long previous(long l)

      Returns the predecessor of a `long` value.

      Parameters:
        `l` - the input value
      Returns:
        `l - 1`

    - #### public static double previous(double d)

      Returns the predecessor of a `double` value.

      Parameters:
        `d` - the input value
      Returns:
        `d - 1`

    - #### public static int remainder(int a, int b)

      Returns the remainder of dividing two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the remainder

    - #### public static long remainder(long a, long b)

      Returns the remainder of dividing two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the remainder

    - #### public static int rightShift(int a, int b)

      Right-shifts an `int` value.

      Parameters:
        `a` - the value to shift
        `b` - the shift distance
      Returns:
        the shifted result

    - #### public static long rightShift(long a, long b)

      Right-shifts a `long` value.

      Parameters:
        `a` - the value to shift
        `b` - the shift distance
      Returns:
        the shifted result

    - #### public static int xor(int a, int b)

      Performs a bitwise XOR on two `int` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise XOR result

    - #### public static long xor(long a, long b)

      Performs a bitwise XOR on two `long` values.

      Parameters:
        `a` - the left operand
        `b` - the right operand
      Returns:
        the bitwise XOR result