mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Merge branch 'master' into rename-repo-url
This commit is contained in:
Vendored
+32
-32
@@ -6,7 +6,7 @@
|
||||
// Development repository: https://github.com/Evgenus/bigint-typescript-definitions
|
||||
// For answers, fixes and cutting edge version please see development repository.
|
||||
|
||||
declare module BigInt {
|
||||
declare namespace BigInt {
|
||||
export interface BigInt extends Array<number> {
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ declare module BigInt {
|
||||
export function inverseMod(x: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* return x**(-1) mod n, for integers x and n.
|
||||
* return x**(-1) mod n, for integers x and n.
|
||||
* Return 0 if there is no inverse.
|
||||
*
|
||||
* @param {number} x The BigInt base.
|
||||
@@ -273,7 +273,7 @@ declare module BigInt {
|
||||
export function powMod(x: BigInt, y: BigInt, n: BigInt): BigInt;
|
||||
|
||||
/**
|
||||
* return an n-bit random BigInt (n>=1).
|
||||
* return an n-bit random BigInt (n>=1).
|
||||
* If s=1, then the most significant of those n bits is set to 1.
|
||||
*
|
||||
* @param {number} n The number of bits (n>=1).
|
||||
@@ -329,7 +329,7 @@ declare module BigInt {
|
||||
export function str2bigInt(s: string, b: string, n?: number, m?: number): BigInt;
|
||||
|
||||
/**
|
||||
* return (x-y) for bigInts x and y.
|
||||
* return (x-y) for bigInts x and y.
|
||||
* Negative answers will be 2s complement.
|
||||
*
|
||||
* @param {BigInt} x The minuend as BigInt.
|
||||
@@ -351,7 +351,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x+n where x is a bigInt and n is an integer.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
@@ -361,7 +361,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x+y for bigInts x and y.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
@@ -371,7 +371,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=y on bigInts x and y.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt destination.
|
||||
@@ -381,7 +381,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=n on bigInt x and integer n.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt destination.
|
||||
@@ -392,7 +392,7 @@ declare module BigInt {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param {BigInt} x The BigInt first dividend.
|
||||
@@ -402,7 +402,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the remainder result.
|
||||
@@ -414,7 +414,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x mod n for bigInts x and n. (This never overflows its array).
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend and the remainder result.
|
||||
@@ -424,7 +424,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x*y for bigInts x and y.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the product result.
|
||||
@@ -434,7 +434,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x*y mod n for bigInts x,y,n.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the remainder result.
|
||||
@@ -446,7 +446,7 @@ declare module BigInt {
|
||||
/**
|
||||
* do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation.
|
||||
* 0**0=1.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the remainder result.
|
||||
@@ -458,7 +458,7 @@ declare module BigInt {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param {BigInt} b The BigInt destination.
|
||||
@@ -469,7 +469,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} ans The destination.
|
||||
@@ -479,7 +479,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x-y for bigInts x and y. Negative answers will be 2s complement.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt minuend and the result difference.
|
||||
@@ -489,7 +489,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x+(y<<(ys*bpe))
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt accumulator.
|
||||
@@ -500,7 +500,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do carries and borrows so each element of the bigInt x fits in bpe bits.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -509,7 +509,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* divide x by y giving quotient q and remainder r.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend.
|
||||
@@ -522,7 +522,7 @@ declare module BigInt {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param {BigInt} x The BigInt dividend and the quotient result.
|
||||
@@ -534,7 +534,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -546,9 +546,9 @@ declare module BigInt {
|
||||
export function eGCD_(x: BigInt, y: BigInt, d: BigInt, a: BigInt, b: BigInt): void;
|
||||
|
||||
/**
|
||||
* do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement.
|
||||
* 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.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -557,7 +557,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* left shift bigInt x by n bits. n<bpe.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -567,7 +567,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=a*x+b*y for bigInts x and y and integers a and b.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt first multiplicand.
|
||||
@@ -579,7 +579,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -591,7 +591,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* Montgomery multiplication (see comments where the function is defined)
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -603,7 +603,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x*n where x is a bigInt and n is an integer.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt multiplicand and the result product.
|
||||
@@ -614,7 +614,7 @@ declare module BigInt {
|
||||
/**
|
||||
* right shift bigInt x by n bits. 0 <= n < bpe.
|
||||
* This never overflows its array.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt to process.
|
||||
@@ -624,7 +624,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x*x mod n for bigInts x,n.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt base and the result remainder.
|
||||
@@ -634,7 +634,7 @@ declare module BigInt {
|
||||
|
||||
/**
|
||||
* do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement.
|
||||
*
|
||||
*
|
||||
* @private Intend to be internal function.
|
||||
*
|
||||
* @param {BigInt} x The BigInt minuend and the result difference.
|
||||
|
||||
Reference in New Issue
Block a user