Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...
    • Compare two arrays for exact equality (or within epsilon when set).

      epsilon = 0 (default) does true equality on each element via Math.abs. Pass a positive epsilon for tolerance-based comparison.

      NaN/Inf semantics (load-bearing for WASM-vs-TS parity): a naive Math.abs(a - b) > epsilon check is NaN-BLIND — when either side is NaN the subtraction is NaN and NaN > epsilon is false, so a backend that emits NaN while the other emits a finite value would be reported EQUAL, silently hiding a real divergence. We therefore:

      • treat NaN-vs-finite (exactly one side NaN) as a MISMATCH,
      • treat NaN-vs-NaN as equal,
      • let the existing magnitude check handle ±Inf correctly: same-sign Inf yields Inf - Inf = NaN (not > epsilon) → equal, while +Inf vs -Inf or Inf vs finite yields Inf > epsilon → mismatch.

      Parameters

      • a: ArrayLike<number>
      • b: ArrayLike<number>
      • epsilon: number = 0

      Returns boolean