Synchronous_reactive_systems/tests/when_merge.node

14 lines
331 B
Plaintext
Raw Normal View History

node test (i: real) returns (o: real);
var x, y: real;
let
x = (1.0 / i) when (i <> 0.0);
y = 0.0 when (not (i <> 0.0));
o = merge (i <> 0.0) x y;
tel
node main (i: real) returns (o: real);
let
-- The idea is to pass `0.0` as the input to acknowledge that the division by zero isn't computed.
o = test(i);
tel