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.
| 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. |
Performs a bitwise AND on two int values.
a - the left operandb - the right operand Performs a bitwise AND on two long values.
a - the left operandb - the right operandChoose a method to replace the originally chosen metaMethod to have a more efficient call path.
Divides one double value by another.
a - the left operandb - the right operand Left-shifts an int value.
a - the value to shiftb - the shift distance Left-shifts a long value.
a - the value to shiftb - the shift distance Subtracts one int value from another.
a - the left operandb - the right operand Subtracts one long value from another.
a - the left operandb - the right operand Subtracts one double value from another.
a - the left operandb - the right operand Returns Groovy's modulo result for two int values.
a - the left operandb - the right operand Returns Groovy's modulo result for two long values.
a - the left operandb - the right operand Multiplies two int values.
a - the left operandb - the right operand Multiplies two long values.
a - the left operandb - the right operand Multiplies two double values.
a - the left operandb - the right operand Returns the successor of an int value.
i - the input valuei + 1 Returns the successor of a long value.
l - the input valuel + 1 Returns the successor of a double value.
d - the input valued + 1 Performs a bitwise OR on two int values.
a - the left operandb - the right operand Performs a bitwise OR on two long values.
a - the left operandb - the right operand Adds two int values.
a - the left operandb - the right operand Adds two long values.
a - the left operandb - the right operand Adds two double values.
a - the left operandb - the right operand Returns the predecessor of an int value.
i - the input valuei - 1 Returns the predecessor of a long value.
l - the input valuel - 1 Returns the predecessor of a double value.
d - the input valued - 1 Returns the remainder of dividing two int values.
a - the left operandb - the right operand Returns the remainder of dividing two long values.
a - the left operandb - the right operand Right-shifts an int value.
a - the value to shiftb - the shift distance Right-shifts a long value.
a - the value to shiftb - the shift distance Performs a bitwise XOR on two int values.
a - the left operandb - the right operand Performs a bitwise XOR on two long values.
a - the left operandb - the right operand