* The expression language has 3-states of string, numeric, and unknown.
The unknown state is either a NaN numeric or a null string, with both
internally considered to have the same "unknown" meaning.
These largely match the IEE 754 semantics for NaN comparisons: <, >, ==,
!= all fail, (even NaN == NaN). Similarly arithmetic (+,-,/,*,%) with
unknown values are still unknown (and false).
The departure from NaN semantics though is that our unknown/null state is
considered to be false while NaN in C is true. Similarly the false nature
of our unknown state meants !val becomes true, !!val is once again false,
val && 1 is false, val || 0 is false, and val || 1 is true along with
!val || 0 and !val && 1.
Note it is possible for empty strings and zero numbers to also be true.
An example of this is the aux string 'NM' which returns true if the
NM tag is found, regardless of whether it is also zero. However the
better approach added in 1.16 is 'exists(NM)'.
* The expression language has 3-states of string, numeric, and unknown. The unknown state is either a NaN numeric or a null string, with both internally considered to have the same "unknown" meaning.
These largely match the IEE 754 semantics for NaN comparisons: <, >, ==, != all fail, (even NaN == NaN). Similarly arithmetic (+,-,/,*,%) with unknown values are still unknown (and false).
The departure from NaN semantics though is that our unknown/null state is considered to be false while NaN in C is true. Similarly the false nature of our unknown state meants !val becomes true, !!val is once again false, val && 1 is false, val || 0 is false, and val || 1 is true along with !val || 0 and !val && 1.
Note it is possible for empty strings and zero numbers to also be true. An example of this is the aux string 'NM' which returns true if the NM tag is found, regardless of whether it is also zero. However the better approach added in 1.16 is 'exists(NM)'.