!=
systemic:core-neqLogicfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| First Value | floatarray | The first numeric series for comparison. |
| Second Value | floatarray | The second numeric series for comparison. |
Outputs
| Name | Type | Description |
|---|---|---|
| NEQ | booleanarray | The element-wise inequality result. |
The Not Equal module performs element-wise inequality comparison between two data series, returning true when values differ and false when they match.
| Value A | Value B | A ≠ B |
|---|---|---|
| 100 | 100 | false |
| 100 | 101 | true |
| 50.5 | 50.5 | false |
| -10 | 10 | true |
Missing Data
If either input is missing (null) at a position — a data gap or a closed-market day — the comparison at that position is null. The module never fabricates a boolean: a one-sided gap is not a "values changed" signal, and two simultaneous gaps are not "values match" — both are simply unknown.
| Value A | Value B | A ≠ B |
|---|---|---|
| 100 | null | null |
| null | 100 | null |
| null | null | null |
NEQ has no mathematically undefined cases beyond missing data: inequality is defined for every pair of real numbers, including infinities.
In live execution the module returns exactly one datapoint — the newest position — which is null when it cannot be determined.
Floating-Point Precision
⚠️ Critical: Floating-point numbers may have tiny precision differences that cause unexpected results.
| Expression | Expected | Actual Result |
|---|---|---|
| 0.1 + 0.2 != 0.3 | false | true |
Why? Computers store decimals in binary, which can't perfectly represent all fractions. The value 0.1 + 0.2 is stored as 0.30000000000000004, making it technically "not equal" to 0.3.
Implication: NEQ may return true for values that are mathematically equal but differ due to floating-point representation.
Input Alignment
When inputs have different lengths or frequencies, Systemic automatically aligns them:
| Scenario | Behavior |
|---|---|
| Different lengths | Shorter series is padded by repeating its last value |
| Different frequencies | Lower-frequency series is upsampled to match |
| Constant vs series | Constant is broadcast to all time points |
Practical Example
Change detection: Compare the current value to the previous value to detect when a signal has changed state. NEQ outputs true at the moment of transition. A data gap on either side produces null, never a false "changed" signal.
Related Modules
- EQ — Equality comparison (opposite of NEQ)
- GTR / LST — Greater than / Less than comparisons
- NOT — Invert boolean results