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

Function combine

src/compute-engine/library/combinatorics.ts:321–332  ·  view source on GitHub ↗
(
          start: number,
          combo: Expression[]
        )

Source from the content-addressed store, hash-verified

319 let steps = 0;
320 for (let i = 2n; i <= m; i++) {
321 if ((++steps & 0xffff) === 0) checkDeadline(ce._deadlineFrame);
322 const next = a + b;
323 a = b;
324 b = next;
325 }
326 result = b;
327 }
328
329 // Reflection formula: F(−m) = (−1)^{m+1} F(m). The previous code built
330 // a malformed `Negate(Fibonacci, m)` (two operands) → an Error.
331 if (k < 0n && m % 2n === 0n) result = -result;
332 return ce.number(result);
333 },
334 },
335

Callers 2

combinatorics.tsFile · 0.70
reduceCollectionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected