Skip to main content

Module recalc

Module recalc 

Source
Expand description

Dependency graph and recalculation.

The graph maps every formula cell to its static precedents (resolved areas). A reverse index answers “which formulas read this cell?”: single-cell precedents in a hash map, ranges as row intervals per column (wide ranges per sheet), each an interval index so a lookup costs O(log n + matches) however many ranges share the column. After an edit, the dirty set is the transitive closure of dependents; it is evaluated in topological order, with on-demand evaluation as a safety net for dynamic references. Cycles produce #CIRC! unless iterative calculation is on: then a formula read while it is being evaluated gives its previous value, and the formulas that read one are evaluated again until the loop settles (PassHost::iterate_loops).

Structs§

Calc
Calculation state kept beside a workbook.
FxHasher
A fast, non-cryptographic hasher for cell keys (FxHash-style multiply-rotate).
Graph

Functions§

evaluate
Evaluates a formula in the context of a cell without storing it (conditional formats, data validation, Evaluate Formula, Name Manager previews, the CLI eval).
evaluate_expr
now_serial
Current date-time as a serial (1900 system), from the system clock (browser clock on wasm). UTC; the local offset isn’t available without platform calls. Falls back to a fixed date only when no clock is available.

Type Aliases§

Key