You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mdl: Vensim :NA: is read as NaN instead of the finite -2^109 #586
Vensim's :NA: is not IEEE NaN; it is the finite number -2^109 (-6.490371073168535e32), which is what makes the common IF THEN ELSE(x = :NA:, ...) existence test work (Vensim documentation, na.html and dataequations.html).
Simlin read :NA: in an equation as NaN and :NA: in a data list as -1e38.
Under NaN the existence test never fires and any arithmetic touching the value turns the whole series NaN; this made hundreds of C-LEARN series entirely NaN.
Status
Fixed on main by #592.
Both paths now produce float::NA (-2^109), pinned bit for bit by a test, and C-LEARN runs without NaN series.
Genuine NaN is still produced where Vensim produces it: out-of-range vector reads and empty reducers.
The comparison against Vensim's VDF output treats Simlin's sentinel as matching Vensim's saved value; two C-LEARN variables still show a sentinel mismatch, tracked in #591.
Pointers
src/simlin-engine/src/float.rs: NA and its module docs
changed the title [-]engine: Vensim :NA: was mishandled as IEEE NaN (should be the finite sentinel -2^109)[/-][+]mdl: Vensim :NA: is read as NaN instead of the finite -2^109[/+]on Oct 12, 2026
float::NA = -2^109 (src/simlin-engine/src/float.rs:110, pinned bit for bit by na_is_negative_two_pow_109 at :274) is what both import paths emit: the expression literal in mdl/xmile_compat.rs:230 and the data-list literal in mdl/parser.rs:55/70, each with its own test (xmile_compat.rs:2373-2383, parser.rs:1952-1990).
Activity
doc: index element-cycle-resolution plan; test-requirements finalizat…
engine: element-level cycle resolution (C-LEARN hero model) (#592)
[-]engine: Vensim :NA: was mishandled as IEEE NaN (should be the finite sentinel -2^109)[/-][+]mdl: Vensim :NA: is read as NaN instead of the finite -2^109[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
float::NA = -2^109 (src/simlin-engine/src/float.rs:110, pinned bit for bit by na_is_negative_two_pow_109 at :274) is what both import paths emit: the expression literal in mdl/xmile_compat.rs:230 and the data-list literal in mdl/parser.rs:55/70, each with its own test (xmile_compat.rs:2373-2383, parser.rs:1952-1990).