MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / reduce

Function reduce

src/compute-engine/numerics/bernoulli.ts:23–30  ·  view source on GitHub ↗
(num: bigint, den: bigint)

Source from the content-addressed store, hash-verified

21}
22
23function reduce(num: bigint, den: bigint): [bigint, bigint] {
24 if (den < 0n) {
25 num = -num;
26 den = -den;
27 }
28 const g = gcd(num, den);
29 return g === 0n ? [0n, 1n] : [num / g, den / g];
30}
31
32function factorial(n: number): bigint {
33 let f = 1n;

Callers 3

bernoulliRationalFunction · 0.70
zetaEvenCoefficientFunction · 0.70
zetaNegativeIntegerFunction · 0.70

Calls 1

gcdFunction · 0.70

Tested by

no test coverage detected