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

Function S

src/compute-engine/library/number-theory.ts:1004–1009  ·  view source on GitHub ↗
(n: bigint, k: bigint)

Source from the content-addressed store, hash-verified

1002 signature: '(integer) -> integer',
1003 type: () => 'finite_integer',
1004 examples: ['PrimitiveRoot(7) // 3'],
1005 evaluate: ([nOp], { engine: ce }) => {
1006 const n = toBigint(nOp);
1007 if (n === null || n < 1n) return undefined;
1008 if (n === 1n) return ce.number(0);
1009 if (n === 2n) return ce.number(1);
1010 if (n === 4n) return ce.number(3);
1011 if (!hasPrimitiveRoot(n, ce._deadlineFrame)) return undefined;
1012 const phi = eulerPhi(n, ce._deadlineFrame);

Callers 1

number-theory.tsFile · 0.85

Calls 1

checkDeadlineFunction · 0.90

Tested by

no test coverage detected