Comparison Functions¶
All comparison functions are dyadic and scalar. They return 1 (true) or 0 (false) for each element pair. They apply element-wise with scalar extension.
Summary¶
| Glyph | Name | 3 f 4 |
4 f 4 |
|---|---|---|---|
< |
Less than | 1 | 0 |
≤ |
Less than or equal | 1 | 1 |
= |
Equal | 0 | 1 |
≥ |
Greater than or equal | 0 | 1 |
> |
Greater than | 0 | 0 |
≠ |
Not equal | 1 | 0 |
Examples¶
Comparison tolerance (⎕CT)¶
Comparisons use tolerant comparison for floating-point values. Two numbers a and b are considered equal if:
The default ⎕CT is 1E¯14. This means very small floating-point differences (from rounding) are ignored:
Set ⎕CT←0 for exact comparison:
Note
Match (≡) and not-match (≢) always use exact comparison, regardless of ⎕CT.