BigInt Typescript Definitions
Options

bigint-typescript-definitions

Documentation

Typescript definitions files for Big Integer library by Leemon

This code was detached from DefinitelyTyped to have repository unrestricted with community rules.

Install with NPM:

npm install bigint-typescript-definitions

Install with NuGet:

PM> Install-Package BigInt.TypeScript.DefinitelyTyped 

Testing:

npm test

Use:

/// <reference path="../node_modules/bigint-typescript-definitions/bigint/bigint.d.ts" />

Index

Modules

Modules

BigInt

BigInt: BigInt

Index

Interfaces

BigInt

BigInt: BigInt
  • (n: number): T in Array<T>
  • Parameters

    • n: number

    Returns T in Array<T>

length

length: number

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

concat

  • concat(items?: Array<U extends T[]>): Array<T>
  • concat(items?: Array<T>): Array<T>
  • Combines two or more arrays.

    Parameters

    • items?: Array<U extends T[]> optional

      Additional items to add to the end of array1.

    Returns Array<T>

  • Combines two or more arrays.

    Parameters

    • items?: Array<T> optional

      Additional items to add to the end of array1.

    Returns Array<T>

every

  • every(callbackfn: Function, thisArg?: any): boolean
  • Determines whether all the members of an array satisfy the specified test.

    Parameters

    • callbackfn: Function

      A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

      • callbackfn function signature
        • (array: Array<T>, index: number, value: T in Array<T>): boolean
        • An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

          Parameters

          • array: Array<T>
          • index: number
          • value: T in Array<T>

          Returns boolean

    • thisArg?: any optional

    Returns boolean

filter

  • filter(callbackfn: Function, thisArg?: any): Array<T>
  • Returns the elements of an array that meet the condition specified in a callback function.

    Parameters

    • callbackfn: Function

      A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, index: number, value: T in Array<T>): boolean
        • An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

          Parameters

          • array: Array<T>
          • index: number
          • value: T in Array<T>

          Returns boolean

    • thisArg?: any optional

    Returns Array<T>

forEach

  • forEach(callbackfn: Function, thisArg?: any)
  • Performs the specified action for each element in an array.

    Parameters

    • callbackfn: Function

      A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, index: number, value: T in Array<T>)
        • An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

          Parameters

          • array: Array<T>
          • index: number
          • value: T in Array<T>
    • thisArg?: any optional

indexOf

  • indexOf(searchElement: T in Array<T>, fromIndex?: number): number
  • Returns the index of the first occurrence of a value in an array.

    Parameters

    • searchElement: T in Array<T>

      The value to locate in the array.

    • fromIndex?: number optional

      The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

    Returns number

join

  • join(separator?: string): string
  • Adds all the elements of an array separated by the specified separator string.

    Parameters

    • separator?: string optional

      A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

    Returns string

lastIndexOf

  • lastIndexOf(searchElement: T in Array<T>, fromIndex?: number): number
  • Returns the index of the last occurrence of a specified value in an array.

    Parameters

    • searchElement: T in Array<T>

      The value to locate in the array.

    • fromIndex?: number optional

      The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

    Returns number

map

  • map(callbackfn: Function, thisArg?: any): Array<U>
  • Calls a defined callback function on each element of an array, and returns an array that contains the results.

    Parameters

    • callbackfn: Function

      A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, index: number, value: T in Array<T>): U
        • An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

          Parameters

          • array: Array<T>
          • index: number
          • value: T in Array<T>

          Returns U

    • thisArg?: any optional

    Returns Array<U>

pop

  • pop(): T in Array<T>
  • Removes the last element from an array and returns it.

    Returns T in Array<T>

push

  • push(items?: Array<T>): number
  • Appends new elements to an array, and returns the new length of the array.

    Parameters

    • items?: Array<T> optional

      New elements of the Array.

    Returns number

reduce

  • reduce(callbackfn: Function, initialValue?: T in Array<T>): T in Array<T>
  • reduce(callbackfn: Function, initialValue: U): U
  • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: Function

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, currentIndex: number, currentValue: T in Array<T>, previousValue: T in Array<T>): T in Array<T>
        • If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

          Parameters

          • array: Array<T>
          • currentIndex: number
          • currentValue: T in Array<T>
          • previousValue: T in Array<T>

          Returns T in Array<T>

    • initialValue?: T in Array<T> optional

    Returns T in Array<T>

  • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: Function

      A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, currentIndex: number, currentValue: T in Array<T>, previousValue: U): U
        • If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

          Parameters

          • array: Array<T>
          • currentIndex: number
          • currentValue: T in Array<T>
          • previousValue: U

          Returns U

    • initialValue: U

    Returns U

reduceRight

  • reduceRight(callbackfn: Function, initialValue?: T in Array<T>): T in Array<T>
  • reduceRight(callbackfn: Function, initialValue: U): U
  • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: Function

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, currentIndex: number, currentValue: T in Array<T>, previousValue: T in Array<T>): T in Array<T>
        • If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

          Parameters

          • array: Array<T>
          • currentIndex: number
          • currentValue: T in Array<T>
          • previousValue: T in Array<T>

          Returns T in Array<T>

    • initialValue?: T in Array<T> optional

    Returns T in Array<T>

  • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

    Parameters

    • callbackfn: Function

      A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

      • callbackfn function signature
        • (array: Array<T>, currentIndex: number, currentValue: T in Array<T>, previousValue: U): U
        • If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

          Parameters

          • array: Array<T>
          • currentIndex: number
          • currentValue: T in Array<T>
          • previousValue: U

          Returns U

    • initialValue: U

    Returns U

reverse

  • reverse(): Array<T>
  • Reverses the elements in an Array.

    Returns Array<T>

shift

  • shift(): T in Array<T>
  • Removes the first element from an array and returns it.

    Returns T in Array<T>

slice

  • slice(start?: number, end?: number): Array<T>
  • Returns a section of an array.

    Parameters

    • start?: number optional

      The beginning of the specified portion of the array.

    • end?: number optional

      The end of the specified portion of the array.

    Returns Array<T>

some

  • some(callbackfn: Function, thisArg?: any): boolean
  • Determines whether the specified callback function returns true for any element of an array.

    Parameters

    • callbackfn: Function

      A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

      • callbackfn function signature
        • (array: Array<T>, index: number, value: T in Array<T>): boolean
        • An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

          Parameters

          • array: Array<T>
          • index: number
          • value: T in Array<T>

          Returns boolean

    • thisArg?: any optional

    Returns boolean

sort

  • sort(compareFn?: Function): Array<T>
  • Sorts an array.

    Parameters

    • compareFn?: Function optional

      The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.

      • compareFn function signature
        • (a: T in Array<T>, b: T in Array<T>): number
        • Parameters

          • a: T in Array<T>
          • b: T in Array<T>

          Returns number

    Returns Array<T>

splice

  • splice(start: number): Array<T>
  • splice(start: number, deleteCount: number, items?: Array<T>): Array<T>
  • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

    Parameters

    • start: number

      The zero-based location in the array from which to start removing elements.

    Returns Array<T>

  • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

    Parameters

    • start: number

      The zero-based location in the array from which to start removing elements.

    • deleteCount: number

      The number of elements to remove.

    • items?: Array<T> optional

      Elements to insert into the array in place of the deleted elements.

    Returns Array<T>

toLocaleString

  • toLocaleString(): string
  • Returns string

toString

  • toString(): string
  • Returns a string representation of an array.

    Returns string

unshift

  • unshift(items?: Array<T>): number
  • Inserts new elements at the start of an array.

    Parameters

    • items?: Array<T> optional

      Elements to insert at the start of the Array.

    Returns number

IRandom

IRandom: IRandom
  • (): number

Functions

GCD

  • return greatest common divisor of bigInts x and y (each with same number of elements).

    Parameters

    • x: BigInt

      The BigInt to process.

    • y: BigInt

      The BigInt to process.

    Returns BigInt

    A greatest common divisor as BigInt.

GCD_

  • set x to the greatest common divisor of bigInts x and y, (y is destroyed). This never overflows its array.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt first dividend.

    • y: BigInt

      The BigInt second dividend.

add

  • return (x+y) for bigInts x and y.

    Parameters

    Returns BigInt

    A sum as BigInt.

addInt

  • return (x+n) where x is a bigInt and n is an integer.

    Parameters

    • x: BigInt

      The BigInt augend.

    • n: number

      The number addend.

    Returns BigInt

    A sum as BigInt.

addInt_

  • addInt_(x: BigInt, n: number)
  • do x=x+n where x is a bigInt and n is an integer.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt accumulator.

    • n: number

      The number addend.

addShift_

  • do x=x+(y<<(ys*bpe))

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt accumulator.

    • y: BigInt

      The BigInt addend to be shifted.

    • ys: number

      The number of shift amount.

add_

  • do x=x+y for bigInts x and y.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt accumulator.

    • y: BigInt

      The BigInt addend.

bigInt2str

  • bigInt2str(x: BigInt, base: number): string
  • bigInt2str(x: BigInt, base: string): string
  • return a string form of bigInt x in a given base, with 2 <= base <= 95.

    Parameters

    • x: BigInt

      The BigInt to stringify.

    • base: number

      The base as radix number.

    Returns string

    A string representation of given BigInt.

  • return a string form of bigInt x in a given base, with 2 <= base <= 95.

    Parameters

    • x: BigInt

      The BigInt to stringify.

    • base: string

      The base as vocabulary of characters.

    Returns string

    A string representation of given BigInt.

bitSize

  • return how many bits long the bigInt x is, not counting leading zeros.

    Parameters

    • x: BigInt

      The BigInt to process.

    Returns number

    A size in BigInt as number.

carry_

  • do carries and borrows so each element of the bigInt x fits in bpe bits.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

copyInt_

  • copyInt_(x: BigInt, n: number)
  • do x=n on bigInt x and integer n.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt destination.

    • n: number

      The number source.

copy_

  • do x=y on bigInts x and y.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt destination.

    • y: BigInt

      The BigInt source.

divInt_

  • divInt_(x: BigInt, n: number): number
  • do x=floor(x/n) for bigInt x and integer n, and return the remainder. This never overflows its array.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt dividend and the quotient result.

    • n: number

      The number divisor.

    Returns number

    A number remainder.

divide_

  • divide x by y giving quotient q and remainder r.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt dividend.

    • y: BigInt

      The BigInt divisor.

    • q: BigInt

      The BigInt quotient.

    • r: BigInt

      The BigInt remainder.

dup

  • return a copy of bigInt x.

    Parameters

    • x: BigInt

      Source BigInt to be copied.

    Returns BigInt

    A copy of this object.

eGCD_

  • sets a,b,d to positive bigInts such that d = GCD_(x,y) = ax-by.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

    • y: BigInt

      The BigInt to process.

    • d: BigInt

      The BigInt to process.

    • a: BigInt

      The BigInt to process.

    • b: BigInt

      The BigInt to process.

equals

  • is the bigInt x equal to the bigint y?

    Parameters

    • x: BigInt

      BigInt to be compared.

    • y: BigInt

      BigInt to be compared.

    Returns boolean

    true if the objects are considered equal, false if they are not.

equalsInt

  • equalsInt(x: BigInt, y: number): boolean
  • is bigint x equal to integer y?

    Parameters

    • x: BigInt

      BigInt to be compared.

    • y: number

      BigInt to be compared.

    Returns boolean

    true if the objects are considered equal, false if not.

expand

  • return a copy of x with at least n elements, adding leading zeros if needed.

    Parameters

    • value: BigInt

      The source object to copy.

    • n: number

      The minimal number of elements.

    Returns BigInt

    A copy of given BigInt.

findPrimes

  • findPrimes(n: number): Array<number>
  • return array of all primes less than integer n.

    Parameters

    • n: number

      Upper limit of search.

    Returns Array<number>

    The found primes as Array.

greater

  • is x>y? (x and y are nonnegative bigInts)

    Parameters

    • x: BigInt

      BigInt to be compared.

    • y: BigInt

      BigInt to be compared.

    Returns boolean

    true if x is greater, false if it's not.

greaterShift

  • greaterShift(x: BigInt, y: BigInt, shift: number): boolean
  • is (x <<(shift*bpe)) > y?

    Parameters

    • x: BigInt

      BigInt to be compared.

    • y: BigInt

      BigInt to be compared.

    • shift: number

      The shift amount in bits.

    Returns boolean

    true if x is greater, false if it's not.

halve_

  • do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. This never overflows its array.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

int2bigInt

  • int2bigInt(t: number, n?: number, m?: number): BigInt
  • return a bigInt equal to integer t, with at least n bits and m array elements.

    Parameters

    • t: number

      The number to process.

    • n?: number optional

      (Optional) the number to process.

    • m?: number optional

      (Optional) the number to process.

    Returns BigInt

    A BigInt equivalent of given number.

inverseMod

  • return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null.

    Parameters

    Returns BigInt

    A BigInt remainder.

inverseModInt

  • inverseModInt(x: number, n: number): BigInt
  • return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse.

    Parameters

    • x: number

      The BigInt base.

    • n: number

      The BigInt divisor.

    Returns BigInt

    A BigInt remainder.

inverseMod_

  • do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt base and the remainder result.

    • n: BigInt

      The BigInt divisor.

    Returns boolean

    true if inverse does exist, false if doesn't.

isZero

  • is the bigInt x equal to zero?

    Parameters

    • x: BigInt

      BigInt to be compared.

    Returns boolean

    true if zero, false if not.

leftShift_

  • leftShift_(x: BigInt, n: number)
  • left shift bigInt x by n bits. n<bpe.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

    • n: number

      The number of bits.

linCombShift_

  • linCombShift_(x: BigInt, y: BigInt, b: number, ys: number)
  • do x=x+b(y<<(ysbpe)) for bigInts x and y, and integers b and ys.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

    • y: BigInt

      The BigInt to process.

    • b: number

      The number to process.

    • ys: number

      The number shift.

linComb_

  • do x=ax+by for bigInts x and y and integers a and b.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt first multiplicand.

    • y: BigInt

      The BigInt second multiplicand.

    • a: number

      The number first multiplier.

    • b: number

      The number second multiplier.

millerRabin

  • does one round of Miller-Rabin base integer b say that bigInt x is possibly prime?

    Parameters

    • x: BigInt

      The BigInt to process.

    • b: BigInt

      The BigInt to process. (b is bigInt, 1<b<x)

    Returns boolean

    true if it is prime, false if it is not.

millerRabinInt

  • millerRabinInt(x: number, b: number): boolean
  • does one round of Miller-Rabin base integer b say that bigInt x is possibly prime?

    Parameters

    • x: number

      The number to process.

    • b: number

      The number to process. (b is int, 1<b<x)

    Returns boolean

    true if it is prime, false if it is not.

mod

  • return a new bigInt equal to (x mod n) for bigInts x and n.

    Parameters

    Returns BigInt

    A remainder as BigInt.

modInt

  • modInt(x: BigInt, n: number): number
  • return x mod n for bigInt x and integer n.

    Parameters

    • x: BigInt

      The dividend.

    • n: number

      The divisor.

    Returns number

    A remainder as number.

mod_

  • do x=x mod n for bigInts x and n. (This never overflows its array).

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt dividend and the remainder result.

    • n: BigInt

      The BigInt divisor.

mont_

  • Montgomery multiplication (see comments where the function is defined)

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

    • y: BigInt

      The BigInt to process.

    • n: BigInt

      The BigInt to process.

    • np: number

      The np.

mult

  • return x*y for bigInts x and y. This is faster when y<x.

    Parameters

    Returns BigInt

    A product as BigInt.

multInt_

  • multInt_(x: BigInt, n: number)
  • do x=x*n where x is a bigInt and n is an integer.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt multiplicand and the result product.

    • n: number

      The number multiplier.

multMod

  • return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.

    Parameters

    Returns BigInt

    A remainder as BigInt.

multMod_

  • do x=x*y mod n for bigInts x,y,n.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt multiplicand and the remainder result.

    • y: BigInt

      The BigInt multiplier.

    • n: BigInt

      The BigInt divisor.

mult_

  • do x=x*y for bigInts x and y.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt multiplicand and the product result.

    • y: BigInt

      The BigInt multiplier.

negative

  • negative(x: BigInt): boolean
  • is bigInt x negative?

    Parameters

    • x: BigInt

      BigInt to be compared.

    Returns boolean

    true if x is negative, false if x is positive.

powMod

  • return (xy mod n) where x,y,n are bigInts and is exponentiation. 0=1. Faster for odd n.

    Parameters

    Returns BigInt

    A remainder as BigInt.

powMod_

  • do x=xy mod n, where x,y,n are bigInts (n is odd) and is exponentiation. 0**0=1.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt base and the remainder result.

    • y: BigInt

      The BigInt exponent.

    • n: BigInt

      The BigInt divisor.

randBigInt

  • randBigInt(n: number, s: number): BigInt
  • return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1.

    Parameters

    • n: number

      The number of bits (n>=1).

    • s: number

      The sign bit.

    Returns BigInt

    A new random BigInt.

randBigInt_

  • randBigInt_(b: BigInt, n: number, s: number)
  • do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.

    private

    Intend to be internal function.

    Parameters

    • b: BigInt

      The BigInt destination.

    • n: number

      The number of bits.

    • s: number

      The sign bit number.

randProbPrime

  • randProbPrime(k: number): BigInt
  • return a new, random, k-bit, probable prime bigInt. Probability it's composite less than 2^- 80.

    Parameters

    • k: number

      The number of bits.

    Returns BigInt

    A new probably random BigInt.

randTruePrime

  • randTruePrime(k: number): BigInt
  • return a new, random, k-bit, true prime bigInt using Maurer's algorithm.

    Parameters

    • k: number

      The number of bits.

    Returns BigInt

    A new random BigInt.

randTruePrime_

  • randTruePrime_(ans: BigInt, k: number)
  • do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.

    private

    Intend to be internal function.

    Parameters

    • ans: BigInt

      The destination.

    • k: number

      The number of bits.

rightShift_

  • rightShift_(x: BigInt, n: number)
  • right shift bigInt x by n bits. 0 <= n < bpe. This never overflows its array.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt to process.

    • n: number

      The number to process.

setRandom

  • Sets a random number generator.

    Parameters

    • random: IRandom

      function that returns random number.

squareMod_

  • do x=x*x mod n for bigInts x,n.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt base and the result remainder.

    • n: BigInt

      The BigInt divisor.

str2bigInt

  • str2bigInt(s: string, b: number, n?: number, m?: number): BigInt
  • str2bigInt(s: string, b: string, n?: number, m?: number): BigInt
  • return a bigInt for number represented in string s in base b with at least n bits and m array elements.

    Parameters

    • s: string

      The string representation of number.

    • b: number

      The base as radix number.

    • n?: number optional

      (Optional) minimal bit length as number.

    • m?: number optional

      (Optional) the number of array elements as number.

    Returns BigInt

    A parsed BigInt.

  • return a bigInt for number represented in string s in base b with at least n bits and m array elements.

    Parameters

    • s: string

      The string representation of number.

    • b: string

      The base as string vocabulary of characters.

    • n?: number optional

      (Optional) minimal bit length as number.

    • m?: number optional

      (Optional) the number of array elements as number.

    Returns BigInt

    A parsed BigInt.

sub

  • return (x-y) for bigInts x and y. Negative answers will be 2s complement.

    Parameters

    • x: BigInt

      The minuend as BigInt.

    • y: BigInt

      The subtrahend as BigInt.

    Returns BigInt

    A difference BigInt.

subShift_

  • do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt minuend and the result difference.

    • y: BigInt

      The BigInt shifted subtrahend .

    • ys: number

      The number shift amount.

sub_

  • do x=x-y for bigInts x and y. Negative answers will be 2s complement.

    private

    Intend to be internal function.

    Parameters

    • x: BigInt

      The BigInt minuend and the result difference.

    • y: BigInt

      The BigInt subtrahend .

trim

  • return a copy of x with exactly k leading zero elements.

    Parameters

    • x: BigInt

      The BigInt to be copied.

    • k: number

      The number of zeroes.

    Returns BigInt

    A copy BigInt.

Legend

  • Container, dynamic module
  • Enumeration
  • Enumeration member
  • Object literal
  • Constructor
  • Variable
  • Function, call signature, accessor
  • Index signature
  • Interface
  • Constructor
  • Property
  • Member, accessor
  • Index signature
  • Class
  • Constructor
  • Property
  • Member, accessor
  • Index signature
  •  
  • Inherited constructor
  • Inherited property
  • Inherited member
  •  
  • Private constructor
  • Private property
  • Private member
  •  
  •  
  • Static property
  • Static member

Generated using TypeDoc