BigIntegerAn arbitrary-precision integer. Construct explicitly with BigInteger.of: (a decimal String or an Integer); arithmetic never mixes silently -- a plain Integer operand is 'message not understood', so convert both sides first. Division truncates toward zero, like Integer.
(BigInteger.of:2).pow:100 "* -> 1267650600228229401496703205376
A BigInteger from a decimal String (any magnitude; raises a ValueError for a non-integer string) or from an Integer.
BigInteger.of:'123456789012345678901234567890' "* -> 123456789012345678901234567890 BigInteger.of:42 "* -> 42
The remainder after truncating division; takes the dividend's sign. Raises an ArithmeticError on a zero divisor.
(BigInteger.of:100) % (BigInteger.of:7) "* -> 2
The product of two BigIntegers.
The sum of two BigIntegers, at any magnitude.
(BigInteger.of:10) + (BigInteger.of:32) "* -> 42
The difference of two BigIntegers.
The quotient of two BigIntegers, truncated toward zero (matching Integer /); raises an ArithmeticError on a zero divisor.
(BigInteger.of:100) / (BigInteger.of:7) "* -> 14
Whether the receiver is less than the BigInteger argument. The one native comparison -- >, <= and >= derive from it.
Whether the argument is an equal BigInteger. Any other type is simply unequal, never an error -- including a plain Integer of the same value.
(BigInteger.of:2) == (BigInteger.of:2) "* -> true (BigInteger.of:2) == 2 "* -> false
The absolute value.
(BigInteger.of:'-7').abs "* -> 7
Convert to a Double, losing precision beyond a Double's ~15-17 significant digits.
(BigInteger.of:'12345678901234567890').asDouble "* -> 12345678901234567000
Narrow to a 64-bit Integer; raises an ArithmeticError if the value does not fit.
(BigInteger.of:42).asInteger "* -> 42
The receiver raised to a non-negative Integer exponent, at full precision. A negative exponent raises an ArithmeticError: there is no fractional escape from the integer domain.
(BigInteger.of:2).pow:100 "* -> 1267650600228229401496703205376
The value as decimal digits, with a leading - when negative.