@Deprecated
public final class MathMDE
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
bitwiseAnd(int x,
int y)
Deprecated.
Returns x & y, the bitwise and of its arguments.
|
static long |
bitwiseAnd(long x,
long y)
Deprecated.
Returns x & y, the bitwise and of its arguments.
|
static int |
bitwiseComplement(int a)
Deprecated.
Returns ~a, the bitwise complement of its argument.
|
static long |
bitwiseComplement(long a)
Deprecated.
Returns ~a, the bitwise complement of its argument.
|
static int |
bitwiseOr(int x,
int y)
Deprecated.
Returns x | y, the bitwise or of its arguments.
|
static long |
bitwiseOr(long x,
long y)
Deprecated.
Returns x | y, the bitwise or of its arguments.
|
static int |
bitwiseXor(int x,
int y)
Deprecated.
Returns x ^ y, the bitwise xor of its arguments.
|
static long |
bitwiseXor(long x,
long y)
Deprecated.
Returns x ^ y, the bitwise xor of its arguments.
|
static double |
div(double x,
double y)
Deprecated.
Divides its arguments.
|
static int |
div(int x,
int y)
Deprecated.
Divides its arguments.
|
static long |
div(long x,
long y)
Deprecated.
Divides its arguments.
|
static double |
gcd_differences(double[] a)
Deprecated.
Return the gcd (greatest common divisor) of the differences
between the elements of double array a.
|
static int |
gcd_differences(int[] a)
Deprecated.
Return the gcd (greatest common divisor) of the differences
between the elements of int array a.
|
static long |
gcd_differences(long[] a)
Deprecated.
Return the gcd (greatest common divisor) of the differences
between the elements of long array a.
|
static double |
gcd(double[] a)
Deprecated.
Return the greatest common divisor of the elements of double array a.
|
static double |
gcd(double a,
double b)
Deprecated.
Return the greatest common divisor of the two arguments.
|
static int |
gcd(int[] a)
Deprecated.
Return the greatest common divisor of the elements of int array a.
|
static int |
gcd(int a,
int b)
Deprecated.
Return the greatest common divisor of the two arguments.
|
static long |
gcd(long[] a)
Deprecated.
Return the greatest common divisor of the elements of long array a.
|
static long |
gcd(long a,
long b)
Deprecated.
Return the greatest common divisor of the two arguments.
|
static int |
logicalAnd(int x,
int y)
Deprecated.
Returns the logical and of its arguments.
|
static long |
logicalAnd(long x,
long y)
Deprecated.
Returns the logical and of its arguments.
|
static int |
logicalOr(int x,
int y)
Deprecated.
Returns the logical or of its arguments.
|
static long |
logicalOr(long x,
long y)
Deprecated.
Returns the logical or of its arguments.
|
static int |
logicalXor(int x,
int y)
Deprecated.
Returns the logical xor of its arguments.
|
static long |
logicalXor(long x,
long y)
Deprecated.
Returns the logical xor of its arguments.
|
static int |
lshift(int x,
int y)
Deprecated.
Returns x << y, the left-shift operation applied to its arguments.
|
static long |
lshift(long x,
long y)
Deprecated.
Returns x << y, the left-shift operation applied to its arguments.
|
static int[] |
missing_numbers(int[] nums)
Deprecated.
Return an array containing all the numbers not in its argument
array (which must be non-empty)
but in the argument's range; that is, bigger than its argument's
minimum value and smaller than its argument's maximum value.
|
static long[] |
missing_numbers(long[] nums)
Deprecated.
Return an array containing all the numbers not in its argument
array (which must be non-empty)
but in the argument's range; that is, bigger than its argument's
minimum value and smaller than its argument's maximum value.
|
static int |
mod_positive(int x,
int y)
Deprecated.
Return z such that
(z == x mod y) && (0 <= z < abs(y)) . |
static long |
mod_positive(long x,
long y)
Deprecated.
Return z such that
(z == x mod y) && (0 <= z < abs(y)) . |
static int |
mod(int x,
int y)
Deprecated.
Returns x % y, the modulus operation applied to its arguments.
|
static long |
mod(long x,
long y)
Deprecated.
Returns x % y, the modulus operation applied to its arguments.
|
static int[] |
modulus_int(java.util.Iterator<java.lang.Integer> itor)
Deprecated.
The iterator produces Integer values.
|
static long[] |
modulus_long(java.util.Iterator<java.lang.Long> itor)
Deprecated.
The iterator produces Long values.
|
static int[] |
modulus_strict_int(java.util.Iterator<java.lang.Integer> itor,
boolean nonstrict_ends)
Deprecated.
The iterator produces Integer values.
|
static long[] |
modulus_strict_long(java.util.Iterator<java.lang.Long> itor,
boolean nonstrict_ends)
Deprecated.
The iterator produces Long values.
|
static int[] |
modulus_strict(int[] nums,
boolean nonstrict_ends)
Deprecated.
Return an array of two integers (r,m) such that each number in NUMS is equal to r (mod m).
|
static long[] |
modulus_strict(long[] nums,
boolean nonstrict_ends)
Deprecated.
Return an array of two integers (r,m) such that each number in NUMS is equal to r (mod m).
|
static int[] |
modulus(int[] nums)
Deprecated.
Return an array of two integers (r,m) such that each number in NUMS is equal to r (mod m).
|
static long[] |
modulus(long[] nums)
Deprecated.
Return an array of two integers (r,m) such that each number in NUMS is equal to r (mod m).
|
static double |
mul(double x,
double y)
Deprecated.
Multiplies its arguments.
|
static int |
mul(int x,
int y)
Deprecated.
Multiplies its arguments.
|
static long |
mul(long x,
long y)
Deprecated.
Multiplies its arguments.
|
static double |
negate(double a)
Deprecated.
Negates its argument.
|
static int |
negate(int a)
Deprecated.
Negates its argument.
|
static long |
negate(long a)
Deprecated.
Negates its argument.
|
static int[] |
nonmodulus_nonstrict(int[] nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod m)
but for every number in NUMS, at least one is equal to every non-r remainder.
|
static long[] |
nonmodulus_nonstrict(long[] nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod m)
but for every number in NUMS, at least one is equal to every non-r remainder.
|
static int[] |
nonmodulus_strict_int(java.util.Iterator<java.lang.Integer> nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod
m) but all missing numbers in their range are.
|
static long[] |
nonmodulus_strict_long(java.util.Iterator<java.lang.Long> nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod
m) but all missing numbers in their range are.
|
static int[] |
nonmodulus_strict(int[] nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod
m) but all missing numbers in their range are.
|
static long[] |
nonmodulus_strict(long[] nums)
Deprecated.
Return a tuple of (r,m) where no number in NUMS is equal to r (mod
m) but all missing numbers in their range are.
|
static int |
pow(int base,
int expt)
Deprecated.
Returns of value of the first argument raised to the
power of the second argument.
|
static long |
pow(long base,
long expt)
Deprecated.
Returns of value of the first argument raised to the
power of the second argument.
|
static int |
rshiftSigned(int x,
int y)
Deprecated.
Returns x >> y, the signed right-shift operation applied to its arguments.
|
static long |
rshiftSigned(long x,
long y)
Deprecated.
Returns x >> y, the signed right-shift operation applied to its arguments.
|
static int |
rshiftUnsigned(int x,
int y)
Deprecated.
Returns x >>> y, the unsigned right-shift operation applied to its arguments.
|
static long |
rshiftUnsigned(long x,
long y)
Deprecated.
Returns x >>> y, the unsigned right-shift operation applied to its arguments.
|
static int |
sign(int a)
Deprecated.
Returns the sign of its argument.
|
public static int negate(int a)
a
- value to negatepublic static long negate(long a)
a
- value to negatepublic static double negate(double a)
a
- value to negatepublic static int bitwiseComplement(int a)
a
- value to bitwise-complementpublic static long bitwiseComplement(long a)
a
- value to bitwise-complementpublic static int mul(int x, int y)
x
- first multiplicandy
- second multiplicandpublic static long mul(long x, long y)
x
- first multiplicandy
- second multiplicandpublic static double mul(double x, double y)
x
- first multiplicandy
- second multiplicandpublic static int div(int x, int y)
x
- dividendy
- divisorpublic static long div(long x, long y)
x
- dividendy
- divisorpublic static double div(double x, double y)
x
- dividendy
- divisorpublic static int mod(int x, int y)
x
- valued to be moddedy
- moduluspublic static long mod(long x, long y)
x
- valued to be moddedy
- moduluspublic static int lshift(int x, int y)
x
- valued to be left-shiftedy
- magnitude of the left-shiftpublic static long lshift(long x, long y)
x
- valued to be left-shiftedy
- magnitude of the left-shiftpublic static int rshiftSigned(int x, int y)
x
- valued to be right-shiftedy
- magnitude of the right-shiftpublic static long rshiftSigned(long x, long y)
x
- valued to be right-shiftedy
- magnitude of the right-shiftpublic static int rshiftUnsigned(int x, int y)
x
- valued to be right-shiftedy
- magnitude of the right-shiftpublic static long rshiftUnsigned(long x, long y)
x
- valued to be right-shiftedy
- magnitude of the right-shiftpublic static int bitwiseAnd(int x, int y)
x
- first operandy
- second operandpublic static long bitwiseAnd(long x, long y)
x
- first operandy
- second operandpublic static int logicalAnd(int x, int y)
x
- first operandy
- second operandpublic static long logicalAnd(long x, long y)
x
- first operandy
- second operandpublic static int bitwiseXor(int x, int y)
x
- first operandy
- second operandpublic static long bitwiseXor(long x, long y)
x
- first operandy
- second operandpublic static int logicalXor(int x, int y)
x
- first operandy
- second operandpublic static long logicalXor(long x, long y)
x
- first operandy
- second operandpublic static int bitwiseOr(int x, int y)
x
- first operandy
- second operandpublic static long bitwiseOr(long x, long y)
x
- first operandy
- second operandpublic static int logicalOr(int x, int y)
x
- first operandy
- second operandpublic static long logicalOr(long x, long y)
x
- first operandy
- second operandpublic static int sign(int a)
a
- value to have its sign takenpublic static int pow(int base, int expt) throws java.lang.ArithmeticException
base
- the baseexpt
- the exponentjava.lang.ArithmeticException
Math.pow(double, double)
public static long pow(long base, long expt) throws java.lang.ArithmeticException
base
- the baseexpt
- the exponentjava.lang.ArithmeticException
Math.pow(double, double)
public static int gcd(int a, int b)
a
- first operandb
- second operandpublic static int gcd(int[] a)
a
- array of operandspublic static int gcd_differences(int[] a)
a
- array of operandspublic static long gcd(long a, long b)
a
- first operandb
- second operandpublic static long gcd(long[] a)
a
- array of operandspublic static long gcd_differences(long[] a)
a
- array of operandspublic static double gcd(double a, double b)
a
- first operandb
- second operandpublic static double gcd(double[] a)
a
- array of operandspublic static double gcd_differences(double[] a)
a
- array of operandspublic static int mod_positive(int x, int y)
(z == x mod y) && (0 <= z < abs(y))
.
This should really be named mod_nonnegative
rather than mod_positive
.x
- value to be moddedy
- moduluspublic static int[] modulus(int[] nums)
nums
- array of operandspublic static int[] modulus_int(java.util.Iterator<java.lang.Integer> itor)
itor
- iterator of operandsmodulus(int[])
public static int[] modulus_strict(int[] nums, boolean nonstrict_ends)
This "_strict" version requires its input to be sorted, and no element may be missing.
This "_strict" version differs from the regular modulus by requiring that the argument be dense: that is, every pair of numbers in the argument array is separated by exactly the modulus.
The endpoints can be treated in two different ways: Either exactly like other numbers in the input, or they can merely be checked for the condition without the strict density requirement.
nums
- array of operandsnonstrict_ends
- whether endpoints are NOT subject to the strict density requirementpublic static int[] modulus_strict_int(java.util.Iterator<java.lang.Integer> itor, boolean nonstrict_ends)
For documentation, see modulus_strict(int[], boolean)
.
itor
- iterator of operandsnonstrict_ends
- whether endpoints are NOT subject to the strict density requirementmodulus_strict(int[], boolean)
public static long mod_positive(long x, long y)
(z == x mod y) && (0 <= z < abs(y))
.
This should really be named mod_nonnegative
rather than mod_positive
.x
- value to be moddedy
- moduluspublic static long[] modulus(long[] nums)
nums
- array of operandspublic static long[] modulus_long(java.util.Iterator<java.lang.Long> itor)
itor
- iterator of operandsmodulus(long[])
public static long[] modulus_strict(long[] nums, boolean nonstrict_ends)
This "_strict" version requires its input to be sorted, and no element may be missing.
This "_strict" version differs from the regular modulus by requiring that the argument be dense: that is, every pair of numbers in the argument array is separated by exactly the modulus.
The endpoints can be treated in two different ways: Either exactly like other numbers in the input, or they can merely be checked for the condition without the strict density requirement.
nums
- array of operandsnonstrict_ends
- whether endpoints are NOT subject to the strict density requirementpublic static long[] modulus_strict_long(java.util.Iterator<java.lang.Long> itor, boolean nonstrict_ends)
For documentation, see modulus_strict(long[], boolean)
.
itor
- iterator of operandsnonstrict_ends
- whether endpoints are NOT subject to the strict density requirementmodulus_strict(int[], boolean)
public static int[] missing_numbers(int[] nums)
nums
- numbers to be excluded; length > 0; may contain duplicatespublic static int[] nonmodulus_strict(int[] nums)
nums
- the list of operandspublic static int[] nonmodulus_strict_int(java.util.Iterator<java.lang.Integer> nums)
nums
- the list of operandspublic static int[] nonmodulus_nonstrict(int[] nums)
nums
- the list of operandspublic static long[] missing_numbers(long[] nums)
nums
- numbers to be excluded; length > 0; may contain duplicatespublic static long[] nonmodulus_strict(long[] nums)
nums
- the list of operandspublic static long[] nonmodulus_strict_long(java.util.Iterator<java.lang.Long> nums)
nums
- the list of operandspublic static long[] nonmodulus_nonstrict(long[] nums)
nums
- the list of operands