BUG: inconsequent behaviour of match() function.
- May 22, 2024
- 1 reply
- 2054 views
Apart from the counter-intuitive behaviour of the match() function (and I suppose this holds also for the lookup functions) as shown here:

Due to the definition of z and A, none of the results should change when the value of TOL is changed. However:

It seems like the value of TOL does 'influence the precision of the comparison' but in an unclear, unpredictable way.
I would suggest that ONLY the 'fuzzy' descriptor/modifier "near" uses the value of TOL. Then "eq" should be implemented as 'equals exactly' and likewise for "leq", "lt", "gt", "geq" and "not". Then with "range" the comparison should be to the borders set by z exactly, after specifying whether or not the border values are in range or not. Then the description of "near" should not use the word, 'closest', because "near" is supposed to use the implicit range from (1-TOL)*z to (1+TOL)*z, where some values may be found closer to z than others.
I suggest to add an option "nearest" to find the value(s) in A that is/are truely 'closest' to z: all values of A that (exactly) equal min(|A-z|). Then also an option "furthest" for the opposite condition.
Success!
Luc

