Class BigIntegerAlgebra
- java.lang.Object
-
- java.lang.Number
-
- java.math.BigInteger
-
- BigIntegerAlgebra
-
- All Implemented Interfaces:
Serializable
,Comparable<BigInteger>
public class BigIntegerAlgebra extends BigInteger
Wrapper forjava.math.
BigInteger
. Required for mixed arithmetic withint
orlong
operands becausejava.math.
BigInteger
does not implement aBigInteger(long)
constructor.
-
-
Field Summary
-
Fields inherited from class java.math.BigInteger
ONE, TEN, TWO, ZERO
-
-
Constructor Summary
Constructors Constructor Description BigIntegerAlgebra(long value)
Constructs a new BigIntegerAlgebra object.
Required for mixed operations: int op BigInteger, BigInteger op intBigIntegerAlgebra(BigInteger value)
Constructs a new BigIntegerAlgebra object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigIntegerAlgebra
add(BigInteger opnd)
Addsopnd
to this.BigIntegerAlgebra
div(BigInteger opnd)
Divides this byopnd
.BigIntegerAlgebra
mul(BigInteger opnd)
(Post)Multiplies this byopnd
.BigIntegerAlgebra
neg()
CallsBigInteger.negate()
.BigIntegerAlgebra
pow(int exponent)
Returns the power ofexponent
of this.BigIntegerAlgebra
remainder(BigInteger opnd)
Returns the remainder of this divided byopnd
.BigIntegerAlgebra
sub(BigInteger opnd)
Subtractsopnd
from this.-
Methods inherited from class java.math.BigInteger
abs, and, andNot, bitCount, bitLength, byteValueExact, clearBit, compareTo, divide, divideAndRemainder, doubleValue, equals, flipBit, floatValue, gcd, getLowestSetBit, hashCode, intValue, intValueExact, isProbablePrime, longValue, longValueExact, max, min, mod, modInverse, modPow, multiply, negate, nextProbablePrime, not, or, probablePrime, setBit, shiftLeft, shiftRight, shortValueExact, signum, sqrt, sqrtAndRemainder, subtract, testBit, toByteArray, toString, toString, valueOf, xor
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Constructor Detail
-
BigIntegerAlgebra
public BigIntegerAlgebra(BigInteger value)
Constructs a new BigIntegerAlgebra object.
-
BigIntegerAlgebra
public BigIntegerAlgebra(long value)
Constructs a new BigIntegerAlgebra object.
Required for mixed operations: int op BigInteger, BigInteger op int
-
-
Method Detail
-
neg
public BigIntegerAlgebra neg()
CallsBigInteger.negate()
.
-
add
public BigIntegerAlgebra add(BigInteger opnd)
- Overrides:
add
in classBigInteger
-
sub
public BigIntegerAlgebra sub(BigInteger opnd)
-
mul
public BigIntegerAlgebra mul(BigInteger opnd)
-
div
public BigIntegerAlgebra div(BigInteger opnd)
-
remainder
public BigIntegerAlgebra remainder(BigInteger opnd)
- Overrides:
remainder
in classBigInteger
-
pow
public BigIntegerAlgebra pow(int exponent)
- Overrides:
pow
in classBigInteger
-
-