Comparison tolerance: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "'''Tolerant comparison''' is an inexact form of comparison used to mitigate the impact of floating-point rounding error on programs. It considers two numbers equal when their relative difference is smaller than a parameter called the '''comparison tolerance''', and accessed with the system variable <syntaxhighlight lang=apl inline>⎕CT</syntaxhighlight>. In addition to the comparison functions, tolerance applies to Match and Not Match, Floor, C...")
 
No edit summary
Line 1: Line 1:
'''Tolerant comparison''' is an inexact form of [[comparison]] used to mitigate the impact of floating-point rounding error on programs. It considers two [[number]]s equal when their relative difference is smaller than a parameter called the '''comparison tolerance''', and accessed with the [[system variable]] <syntaxhighlight lang=apl inline>⎕CT</syntaxhighlight>. In addition to the comparison functions, tolerance applies to [[Match]] and [[Not Match]], [[Floor]], [[Ceiling]], and [[Modulus]], and [[search functions]] defined in terms of Match (not [[Interval Index]]).
'''Tolerant comparison''' is an inexact form of [[comparison]] used to mitigate the impact of floating-point rounding error on programs. It considers two [[number]]s equal when their relative difference is smaller than a parameter called the '''comparison tolerance''', and accessed with the [[system variable]] <syntaxhighlight lang=apl inline>⎕CT</syntaxhighlight>. In addition to the comparison functions, tolerance applies to [[Match]] and [[Not Match]], [[Floor]], [[Ceiling]], and [[Modulus]], and [[search function]]s defined in terms of Match (not [[Interval Index]]).


{{quote|In an early talk Ken was explaining the advantages of tolerant comparison. A member of the audience asked incredulously, "Surely you don't mean that when <nowiki>A=B and B=C</nowiki>, A may not equal C?" Without skipping a beat, Ken replied, "Any carpenter knows that!" and went on to the next question.|—Paul Berry<ref>[[Roger Hui]]. [https://keiapl.org/anec/ Ken Iverson Quotations and Anecdotes]. 2005-09-30.</ref>}}
{{quote|In an early talk Ken was explaining the advantages of tolerant comparison. A member of the audience asked incredulously, "Surely you don't mean that when <nowiki>A=B and B=C</nowiki>, A may not equal C?" Without skipping a beat, Ken replied, "Any carpenter knows that!" and went on to the next question.|—Paul Berry<ref>[[Roger Hui]]. [https://keiapl.org/anec/ Ken Iverson Quotations and Anecdotes]. 2005-09-30.</ref>}}
Line 12: Line 12:
== References ==
== References ==
<references/>
<references/>
{{APL built-ins}}[[Category:Function characteristics]][[Category:System constants]]

Navigation menu