Source Code

This module provides an arbitrary-precision integer numeric type.

The type Whole is a first-class numeric type and support all the usual mathematical operations:

Whole i = wholeNumber(12P);
Whole j = wholeNumber(3);
Whole n = i**j + j;
print(n); //prints 1728000000000000000000000000000000000003
By: Tom Bentley, John Vasileff

Arbitrary precision integer arithmetic.

Dependencies (jvm)1.2.1
java.base (jvm)8

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 = ...)
  • whole
    • is WholeImpl whole
  • radix = 10
    • minRadix <= radix <= maxRadix
gcdSource Codeshared Whole gcd(Whole first, Whole second)

The greatest common divisor.

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
See also formatWhole()
wholeNumberSource Codeshared Whole wholeNumber(Integer number)

The given number converted to a Whole.

WholeSource Codeshared Whole

An arbitrary precision integer.