ready to merge
This commit is contained in:
parent
fbe007f359
commit
bd073bc48b
36
docs/API.md
36
docs/API.md
|
@ -39,7 +39,7 @@ Some common functions for modular arithmetic using native JS implementation of B
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[modPow.ts:8](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/modPow.ts#L8)
|
[modPow.ts:8](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modPow.ts#L8)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ ___
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
phi.ts:1
|
[phi.ts:1](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/phi.ts#L1)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ ___
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[modPow.ts:7](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/modPow.ts#L7)
|
[modPow.ts:7](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modPow.ts#L7)
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ The absolute value of a
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[abs.ts:8](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/abs.ts#L8)
|
[abs.ts:8](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/abs.ts#L8)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ The bit length
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[bitLength.ts:7](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/bitLength.ts#L7)
|
[bitLength.ts:7](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/bitLength.ts#L7)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ x
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
crt.ts:16
|
[crt.ts:16](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/crt.ts#L16)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ A triple (g, x, y), such that ax + by = g = gcd(a, b).
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[egcd.ts:17](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/egcd.ts#L17)
|
[egcd.ts:17](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/egcd.ts#L17)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ The greatest common divisor of a and b
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[gcd.ts:11](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/gcd.ts#L11)
|
[gcd.ts:11](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/gcd.ts#L11)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ The least common multiple of a and b
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[lcm.ts:11](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/lcm.ts#L11)
|
[lcm.ts:11](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/lcm.ts#L11)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ Maximum of numbers a and b
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[max.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/max.ts#L9)
|
[max.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/max.ts#L9)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ Minimum of numbers a and b
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[min.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/min.ts#L9)
|
[min.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/min.ts#L9)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ The smallest positive integer that is congruent with (a_1 + ... + a_r) mod n
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
modAdd.ts:9
|
[modAdd.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modAdd.ts#L9)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ The inverse modulo n
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[modInv.ts:14](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/modInv.ts#L14)
|
[modInv.ts:14](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modInv.ts#L14)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ The smallest positive integer that is congruent with (a_1 * ... * a_r) mod n
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
modMultiply.ts:9
|
[modMultiply.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modMultiply.ts#L9)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ b**e mod n
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[modPow.ts:22](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/modPow.ts#L22)
|
[modPow.ts:22](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/modPow.ts#L22)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ A function that computes the Euler's totien function of a number n, whose prime
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| :------ | :------ | :------ |
|
| :------ | :------ | :------ |
|
||||||
| `primeFactorization` | [`PrimeFactorization`](API.md#primefactorization) | an array of arrays containing the prime power factorization, i.e. for n = (p1**k1)*(p2**k2)*...*(pr**kr), one should provide [[p1, k1], [p2, k2], ... , [pr, kr]] |
|
| `primeFactorization` | [`PrimeFactorization`](API.md#primefactorization) | an array of arrays containing the prime power factorization of a number n. For example, for n = (p1**k1)*(p2**k2)*...*(pr**kr), one should provide [[p1, k1], [p2, k2], ... , [pr, kr]] |
|
||||||
|
|
||||||
#### Returns
|
#### Returns
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ phi((p1**k1)*(p2**k2)*...*(pr**kr))
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
phi.ts:9
|
[phi.ts:9](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/phi.ts#L9)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -435,4 +435,4 @@ A bigint with the smallest positive representation of a modulo n
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[toZn.ts:14](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/toZn.ts#L14)
|
[toZn.ts:14](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/toZn.ts#L14)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[egcd.ts:2](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/egcd.ts#L2)
|
[egcd.ts:2](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/egcd.ts#L2)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ ___
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[egcd.ts:3](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/egcd.ts#L3)
|
[egcd.ts:3](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/egcd.ts#L3)
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
@ -36,4 +36,4 @@ ___
|
||||||
|
|
||||||
#### Defined in
|
#### Defined in
|
||||||
|
|
||||||
[egcd.ts:4](https://github.com/juanelas/bigint-mod-arith/blob/80793b3/src/ts/egcd.ts#L4)
|
[egcd.ts:4](https://github.com/juanelas/bigint-mod-arith/blob/fbe007f/src/ts/egcd.ts#L4)
|
||||||
|
|
|
@ -3,7 +3,7 @@ export type PrimeFactorization = Array<[bigint, bigint]>
|
||||||
/**
|
/**
|
||||||
* A function that computes the Euler's totien function of a number n, whose prime power factorization is known
|
* A function that computes the Euler's totien function of a number n, whose prime power factorization is known
|
||||||
*
|
*
|
||||||
* @param primeFactorization an array of arrays containing the prime power factorization, i.e. for n = (p1**k1)*(p2**k2)*...*(pr**kr), one should provide [[p1, k1], [p2, k2], ... , [pr, kr]]
|
* @param primeFactorization an array of arrays containing the prime power factorization of a number n. For example, for n = (p1**k1)*(p2**k2)*...*(pr**kr), one should provide [[p1, k1], [p2, k2], ... , [pr, kr]]
|
||||||
* @returns phi((p1**k1)*(p2**k2)*...*(pr**kr))
|
* @returns phi((p1**k1)*(p2**k2)*...*(pr**kr))
|
||||||
*/
|
*/
|
||||||
export function phi (primeFactorization: PrimeFactorization): bigint {
|
export function phi (primeFactorization: PrimeFactorization): bigint {
|
||||||
|
|
Loading…
Reference in New Issue