Return the absolute value of this integer. If this value is positive then return this, otherwise return the negation.
Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit.
Decrement by one. Shortcut is --a or a--.
Flip the given bit between 0 and 1. Equivalent to this.xor(1.shiftl(b)).
The hash for a BigInt is platform dependent.
Increment by one. Shortcut is ++a or a++.
Return remainder of this divided by b. Shortcut is a%b.
Negative of this. Shortcut is -a.
Bitwise not/inverse of this.
Return this value raised to the specified power. Throw ArgErr if pow is less than zero.
Bitwise left shift of this by b. Negative values call shiftr instead.
Bitwise arithmetic right-shift of this by b. Note that this is similar to Int.shifta, not Int.shiftr. Sign extension is performed. Negative values call shiftl instead.
-1, 0, 1 if the BigInt is negative, zero, or positive.
Return true if given bit is 1. Equivalent to this.and(1.shiftl(b)) != 0.
Returns a byte array containing the two's-complement representation of this BigInt.
Convert the number to an Decimal.
This simply wraps the BigInt with Decimal with a 0 scale, equivilent mathematically to int * 2^0
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.
Get an immutable representation of this instance or throw NotImmutableErr if this object cannot be represented as an immutable:
Convert the number to an Int.
If the value is out-of-range and checked is true, an Err is thrown. Otherwise the value is truncated, with possible loss of sign.
Optional
checked: booleanReturn string representation in given radix. If width is non-null, then leading zeros are prepended to ensure the specified width.
Optional
width: numberReturn decimal string representation.
Trap a dynamic call for handling. Dynamic calls are invoked with the -> shortcut operator:
a->x a.trap("x", null)
a->x() a.trap("x", null)
a->x = b a.trap("x", [b])
a->x(b) a.trap("x", [b])
a->x(b, c) a.trap("x", [b, c])
The default implementation provided by Obj attempts to use reflection. If name maps to a method, it is invoked with the specified arguments. If name maps to a field and args.size is zero, get the field. If name maps to a field and args.size is one, set the field and return args[0]. Otherwise throw UnknownSlotErr.
This method called whenever an it-block is applied to an
object. The default implementation calls the function with this
,
and then returns this
.
Static
defDefault value is 0.
Static
echoWrite x.toStr
to standard output followed by newline. If x
is null then print "null". If no argument is provided then
print an empty line.
Optional
x: JsObjStatic
fromParse a Str into a BigInt using the specified radix. If invalid format and checked is false return null, otherwise throw ParseErr.
Optional
radix: numberOptional
checked: booleanStatic
makeStatic
makeReturns a BigInt whose value is equal to that of the specified Int.
Static
oneStatic
zero
Immutable arbitrary-precision integer.