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" />
Combines two or more arrays.
Additional items to add to the end of array1.
Combines two or more arrays.
Additional items to add to the end of array1.
Determines whether all the members of an array satisfy the specified test.
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.
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Returns the elements of an array that meet the condition specified in a callback function.
A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Performs the specified action for each element in an array.
A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Returns the index of the first occurrence of a value in an array.
The value to locate in the array.
The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Adds all the elements of an array separated by the specified separator string.
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 the index of the last occurrence of a specified value in an array.
The value to locate in the array.
The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
Calls a defined callback function on each element of an array, and returns an array that contains the results.
A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Removes the last element from an array and returns it.
Appends new elements to an array, and returns the new length of the array.
New elements of the Array.
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.
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
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.
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.
A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
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.
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.
A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
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.
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.
A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
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.
Reverses the elements in an Array.
Removes the first element from an array and returns it.
Returns a section of an array.
The beginning of the specified portion of the array.
The end of the specified portion of the array.
Determines whether the specified callback function returns true for any element of an array.
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.
An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
Sorts an array.
The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements.
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements.
The number of elements to remove.
Elements to insert into the array in place of the deleted elements.
Returns a string representation of an array.
Inserts new elements at the start of an array.
Elements to insert at the start of the Array.
do x=x+n where x is a bigInt and n is an integer.
The BigInt accumulator.
The number addend.
return a string form of bigInt x in a given base, with 2 <= base <= 95.
The BigInt to stringify.
The base as radix number.
A string representation of given BigInt.
return a string form of bigInt x in a given base, with 2 <= base <= 95.
The BigInt to stringify.
The base as vocabulary of characters.
A string representation of given BigInt.
return how many bits long the bigInt x is, not counting leading zeros.
The BigInt to process.
A size in BigInt as number.
do carries and borrows so each element of the bigInt x fits in bpe bits.
The BigInt to process.
do x=n on bigInt x and integer n.
The BigInt destination.
The number source.
do x=floor(x/n) for bigInt x and integer n, and return the remainder. This never overflows its array.
The BigInt dividend and the quotient result.
The number divisor.
A number remainder.
is bigint x equal to integer y?
BigInt to be compared.
BigInt to be compared.
true if the objects are considered equal, false if not.
return array of all primes less than integer n.
Upper limit of search.
The found primes as Array.
do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. This never overflows its array.
The BigInt to process.
return a bigInt equal to integer t, with at least n bits and m array elements.
The number to process.
(Optional) the number to process.
(Optional) the number to process.
A BigInt equivalent of given number.
return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse.
The BigInt base.
The BigInt divisor.
A BigInt remainder.
is the bigInt x equal to zero?
BigInt to be compared.
true if zero, false if not.
left shift bigInt x by n bits. n<bpe.
The BigInt to process.
The number of bits.
does one round of Miller-Rabin base integer b say that bigInt x is possibly prime?
The number to process.
The number to process. (b is int, 1<b<x)
true if it is prime, false if it is not.
return x mod n for bigInt x and integer n.
The dividend.
The divisor.
A remainder as number.
do x=x*n where x is a bigInt and n is an integer.
The BigInt multiplicand and the result product.
The number multiplier.
is bigInt x negative?
BigInt to be compared.
true if x is negative, false if x is positive.
return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1.
The number of bits (n>=1).
The sign bit.
A new random BigInt.
do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
The BigInt destination.
The number of bits.
The sign bit number.
return a new, random, k-bit, probable prime bigInt. Probability it's composite less than 2^- 80.
The number of bits.
A new probably random BigInt.
return a new, random, k-bit, true prime bigInt using Maurer's algorithm.
The number of bits.
A new random BigInt.
do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
The destination.
The number of bits.
right shift bigInt x by n bits. 0 <= n < bpe. This never overflows its array.
The BigInt to process.
The number to process.
Sets a random number generator.
function that returns random number.
return a bigInt for number represented in string s in base b with at least n bits and m array elements.
The string representation of number.
The base as radix number.
(Optional) minimal bit length as number.
(Optional) the number of array elements as number.
A parsed BigInt.
return a bigInt for number represented in string s in base b with at least n bits and m array elements.
The string representation of number.
The base as string vocabulary of characters.
(Optional) minimal bit length as number.
(Optional) the number of array elements as number.
A parsed BigInt.
Generated using TypeDoc
Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.