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

Function checkBound

src/compute-engine/library/utils.ts:375–384  ·  view source on GitHub ↗

* A summation/product limit (lower or upper bound) must be numeric. Accept a * `Nothing` sentinel (an open bound), an already-invalid operand, and anything * that could evaluate to a number (a number literal, a numeric expression, or * an unknown symbol). Reject a *provably* non-numeric bound (a

(bound: Expression | null)

Source from the content-addressed store, hash-verified

373 );
374}
375
376/**
377 * The indexing sets of a `Sum` or `Product`, with the default bounds put in
378 * place of a clause that has no bounds. A sum or product written with no
379 * bounds (`\sum_k f`, `Limits(k, Nothing, Nothing)`) runs over
380 * `k = 1, 2, 3, …`, so the clause is read as `Limits(k, 1, +∞)`, and the
381 * operator gives the same result as `\sum_{k=1}^{\infty} f` under
382 * `evaluate()`, `N()` and `simplify()` (user decision 2026-10-20). The
383 * numeric iteration in `normalizeIndexingSet()` already used these defaults.
384 *
385 * The canonical form keeps the clause with no bounds: the defaults apply only
386 * when the operator is evaluated or simplified. The index symbol of the
387 * clause is kept as it is, so it keeps its binding in the scope of the

Callers 1

canonicalIndexingSetFunction · 0.85

Calls 3

isSymbolFunction · 0.90
matchesMethod · 0.65
typeErrorMethod · 0.65

Tested by

no test coverage detected