Arbitrary precision integer arithmetic. The focus of this package is the Whole type which performs calculations using arbitrary precision integer arithmetic. An instance of Whole may be obtained by calling wholeNumber() or parseWhole().

oneSource Codeshared Whole one

A Whole instance representing one.

twoSource Codeshared Whole two

A Whole instance representing two.

zeroSource Codeshared Whole zero

A Whole instance representing zero.

formatWholeSource Codeshared String formatWhole(Whole whole, Integer radix = ...)

The string representation of the given whole in the base given by radix. If the given Whole is negative, the string representation will begin with -. Digits consist of decimal digits 0 to 9, together with and lowercase letters a to z for bases greater than 10.

For example:

  • formatWhole(wholeNumber(-46)) is "-46"
  • formatWhole(wholeNumber(9),2) is "1001"
  • formatWhole(wholeNumber(10),8) is "12"
  • formatWhole(wholeNumber(511),16) is "1ff"
  • formatWhole(wholeNumber(512),32) is "g0"
  • whole
    • is WholeImpl whole
  • radix = 10
    • minRadix <= radix <= maxRadix
fromImplementationSource Codeshared Whole fromImplementation(Object implementation)

Converts a platform-specific implementation object to a Whole instance. This is provided for interoperation with the runtime platform.

  • implementation
    • is BigInteger implementation
parseWholeSource Codeshared Whole? parseWhole(String string, Integer radix = ...)

The Whole represented by the given string, or null if the given string does not represent a Whole.

  • string

    The string representation to parse.

  • radix = 10

    The base, between minRadix and maxRadix inclusive.

    • minRadix <= radix <= maxRadix
wholeNumberSource Codeshared Whole wholeNumber(Integer number)

The given number converted to a Whole.

WholeSource Codeshared Whole

An arbitrary precision integer.