Does ⎕CT tolerance apply to complex numbers in nested arrays?
0 reputation · 04 Feb 2022, 18:49 UTC
Goal
Determine whether comparison tolerance ⎕CT applies to complex numbers nested inside arrays, and whether enclosing primitives such as match (≡) and find (⍳) propagate that tolerance to complex leaf elements.
Uncertainty
⎕CT is well established for floating-point equality, with a default commonly near 1E-14 in Dyalog APL and implementation-specific elsewhere. Vendor references do not uniformly specify complex-number tolerance or its behavior inside nested arrays. As a result, expressions such as comparing 1+1E-15j to 1, or matching nested arrays containing complex values, may return different booleans across interpreters.
Does ⎕CT affect equality of complex scalars such as 1+1E-15j and 1? When ≡ or ⍳ compares nested arrays, does tolerance apply to complex leaf elements? Which implementations document this behavior, and where is it left unspecified?