Unique: Difference between revisions

Jump to navigation Jump to search
10 bytes added ,  11:35, 26 August 2023
m
→‎Tolerant comparison: clarify ambiguous wording
m (Text replacement - "</source>" to "</syntaxhighlight>")
Tags: Mobile edit Mobile web edit
m (→‎Tolerant comparison: clarify ambiguous wording)
Line 45: Line 45:
=== Tolerant comparison ===
=== Tolerant comparison ===


The following example shows why we must be careful about how cells are matched when tolerant comparison is involved. Here we produce a vector in which the first and second elements match, as do the second and third, but the first and third elements do not! Unique produces an array which contains an element matching every element of the original array, but a less careful definition (for example, excluding every element which matches an earlier one) would fail to satisfy this property.
The following example shows why we must be careful about how cells are matched when tolerant comparison is involved. Here we produce a vector in which the first and second elements match, as do the second and third, but the first and third elements do not! Unique produces an array Z such that each element of the original array matches at least one element of Z, but a less careful definition (for example, excluding every element which matches an earlier one) would fail to satisfy this property.
<syntaxhighlight lang=apl>
<syntaxhighlight lang=apl>
       ⎕CT←1e¯14
       ⎕CT←1e¯14
trusted
83

edits

Navigation menu