type
constructors
fromStr |
Parse a Str into a BigInt using the specified radix. |
---|---|
makeBuf |
Translates a byte array containing the two's-complement binary representation of a BigInt into a BigInt. |
makeInt |
Returns a BigInt whose value is equal to that of the specified Int. |
fields
methods
abs |
Return the absolute value of this integer. |
---|---|
and |
Bitwise-and of this and b. |
bitLen |
Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit. |
clearBit |
Set the given bit to 0. |
compare |
Compare based on integer value. |
decrement |
Decrement by one. |
div |
Divide this by b. |
divInt |
Divide this by b. |
equals |
Return true if same both represent that same integer value. |
flipBit |
Flip the given bit between 0 and 1. |
hash |
The hash for a BigInt is platform dependent. |
increment |
Increment by one. |
max |
Return the larger of this and the specified BigInt values. |
min |
Return the smaller of this and the specified BigInt values. |
minus |
Subtract b from this. |
minusInt |
Subtract b from this. |
mod |
Return remainder of this divided by b. |
modInt |
Return remainder of this divided by b. |
mult |
Multiply this with b. |
multInt |
Multiply this with b. |
negate |
Negative of this. |
not |
Bitwise not/inverse of this. |
or |
Bitwise-or of this and b. |
plus |
Add this with b. |
plusInt |
Add this with b. |
pow |
Return this value raised to the specified power. |
setBit |
Set the given bit to 1. |
shiftl |
Bitwise left shift of this by b. |
shiftr |
Bitwise arithmetic right-shift of this by b. |
signum |
-1, 0, 1 if the BigInt is negative, zero, or positive. |
testBit |
Return true if given bit is 1. |
toBuf |
Returns a byte array containing the two's-complement representation of this BigInt. |
toDecimal |
Convert the number to an Decimal. |
toFloat |
Convert the number to an Float. |
toInt |
Convert the number to an Int. |
toRadix |
Return string representation in given radix. |
toStr |
Return decimal string representation. |
xor |
Bitwise-exclusive-or of this and b. |
Slot Details
abs
BigInt abs()
Return the absolute value of this integer. If this value is positive then return this, otherwise return the negation.
and
bitLen
Int bitLen()
Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit.
clearBit
compare
decrement
defVal
const static BigInt defVal
Default value is 0.
div
divInt
equals
flipBit
fromStr
hash
virtual override Int hash()
The hash for a BigInt is platform dependent.
increment
makeBuf
new makeBuf(Buf bytes)
Translates a byte array containing the two's-complement binary representation of a BigInt into a BigInt.
makeInt
new makeInt(Int val)
Returns a BigInt whose value is equal to that of the specified Int.
max
min
minus
minusInt
mod
modInt
mult
multInt
negate
not
BigInt not()
Bitwise not/inverse of this.
one
const static BigInt one
or
plus
plusInt
pow
setBit
shiftl
shiftr
signum
Int signum()
-1, 0, 1 if the BigInt is negative, zero, or positive.
testBit
toBuf
Buf toBuf()
Returns a byte array containing the two's-complement representation of this BigInt.
toDecimal
Decimal toDecimal()
Convert the number to an Decimal.
This simply wraps the BigInt with Decimal with a 0 scale, equivilent mathematically to int * 2^0
toFloat
Float toFloat()
Convert the number to an Float.
If the value is out-of-range, it will return Float.posInf or Float.negInf. Possible loss of precision is still possible, even if the value is finite.
toInt
toRadix
toStr
virtual override Str toStr()
Return decimal string representation.
xor
zero
const static BigInt zero