java.math
Class Logical
java.lang.Object
java.math.Logical
class Logical
- extends Object
The library implements some logical operations over BigInteger. The
operations provided are listed below.
|
Method Summary |
(package private) static BigInteger |
and(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
andDiffSigns(BigInteger positive,
BigInteger negative)
|
(package private) static BigInteger |
andNegative(BigInteger longer,
BigInteger shorter)
|
(package private) static BigInteger |
andNot(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
andNotNegative(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
andNotNegativePositive(BigInteger negative,
BigInteger positive)
|
(package private) static BigInteger |
andNotPositive(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
andNotPositiveNegative(BigInteger positive,
BigInteger negative)
|
(package private) static BigInteger |
andPositive(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
not(BigInteger val)
|
(package private) static BigInteger |
or(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
orDiffSigns(BigInteger positive,
BigInteger negative)
|
(package private) static BigInteger |
orNegative(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
orPositive(BigInteger longer,
BigInteger shorter)
|
(package private) static BigInteger |
xor(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
xorDiffSigns(BigInteger positive,
BigInteger negative)
|
(package private) static BigInteger |
xorNegative(BigInteger val,
BigInteger that)
|
(package private) static BigInteger |
xorPositive(BigInteger longer,
BigInteger shorter)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
not
static BigInteger not(BigInteger val)
- See Also:
BigInteger.not()
and
static BigInteger and(BigInteger val,
BigInteger that)
- See Also:
BigInteger.and(BigInteger)
andPositive
static BigInteger andPositive(BigInteger val,
BigInteger that)
- Returns:
- sign = 1, magnitude = val.magnitude & that.magnitude
andDiffSigns
static BigInteger andDiffSigns(BigInteger positive,
BigInteger negative)
- Returns:
- sign = positive.magnitude & magnitude = -negative.magnitude
andNegative
static BigInteger andNegative(BigInteger longer,
BigInteger shorter)
- Returns:
- sign = -1, magnitude = -(-longer.magnitude & -shorter.magnitude)
andNot
static BigInteger andNot(BigInteger val,
BigInteger that)
- See Also:
BigInteger.andNot(BigInteger)
andNotPositive
static BigInteger andNotPositive(BigInteger val,
BigInteger that)
- Returns:
- sign = 1, magnitude = val.magnitude & ~that.magnitude
andNotPositiveNegative
static BigInteger andNotPositiveNegative(BigInteger positive,
BigInteger negative)
- Returns:
- sign = 1, magnitude = positive.magnitude & ~(-negative.magnitude)
andNotNegativePositive
static BigInteger andNotNegativePositive(BigInteger negative,
BigInteger positive)
- Returns:
- sign = -1, magnitude = -(-negative.magnitude & ~positive.magnitude)
andNotNegative
static BigInteger andNotNegative(BigInteger val,
BigInteger that)
- Returns:
- sign = 1, magnitude = -val.magnitude & ~(-that.magnitude)
or
static BigInteger or(BigInteger val,
BigInteger that)
- See Also:
BigInteger.or(BigInteger)
orPositive
static BigInteger orPositive(BigInteger longer,
BigInteger shorter)
- Returns:
- sign = 1, magnitude = longer.magnitude | shorter.magnitude
orNegative
static BigInteger orNegative(BigInteger val,
BigInteger that)
- Returns:
- sign = -1, magnitude = -(-val.magnitude | -that.magnitude)
orDiffSigns
static BigInteger orDiffSigns(BigInteger positive,
BigInteger negative)
- Returns:
- sign = -1, magnitude = -(positive.magnitude | -negative.magnitude)
xor
static BigInteger xor(BigInteger val,
BigInteger that)
- See Also:
BigInteger.xor(BigInteger)
xorPositive
static BigInteger xorPositive(BigInteger longer,
BigInteger shorter)
- Returns:
- sign = 0, magnitude = longer.magnitude | shorter.magnitude
xorNegative
static BigInteger xorNegative(BigInteger val,
BigInteger that)
- Returns:
- sign = 0, magnitude = -val.magnitude ^ -that.magnitude
xorDiffSigns
static BigInteger xorDiffSigns(BigInteger positive,
BigInteger negative)
- Returns:
- sign = 1, magnitude = -(positive.magnitude ^ -negative.magnitude)
Please submit a feedback, bug or feature