Is there a simple way, to send null value (no value) form C code to mjs in double variable? i.e. ffi(‘double read_val(void)’)
my ideas is:
- send negative value (-1.0) and check that in mjs: if (val >= 0.0){ do_something_useful(); }
- send NaN and check it mjs - how?
- may be using pointers? where NULL pointer means no value (null, nil, etc).
- or some other constant e.g. -infinity?
best, if checking will look simple, like ‘if (val) { do_something_useful(); }’