cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

match function bug

ifomenko
15-Moonstone

match function bug

I met strange situation with match function.That`s the problem?

match bug.png

With unitless V all is OK

1 ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald II
(To:ifomenko)

Igor Fomenko wrote:

I met strange situation with match function.That`s the problem?

With unitless V all is OK

I don't think you're looking at a bug, but more likely the effect of your default TOL setting on how close 3 sq cm has to be each element of V (don't forget Mathcad internally converts sq cm to sq m).

Stuart

View solution in original post

3 REPLIES 3
StuartBruff
23-Emerald II
(To:ifomenko)

Igor Fomenko wrote:

I met strange situation with match function.That`s the problem?

With unitless V all is OK

I don't think you're looking at a bug, but more likely the effect of your default TOL setting on how close 3 sq cm has to be each element of V (don't forget Mathcad internally converts sq cm to sq m).

Stuart

It's a tolerance problem:

change the tolerance:

As Stuart and Fred already have written, its not a bug, its a feature

Hmm, but a very annoying one. Changing the value of TOL to a much lower value may have undesired side effects on other numeric calculations.

In Mathcad we also have "Match" (note the capital "M") with its modifiers , but unfortunately there is no modifier "equal" and equal  means also here wrt the base unit and the value of TOL.

So the only way to avoid this "feature" (which I consider simply a very bad implementation) is to write your own match function:

This also copes with the often annoying error which is thrown by the built-in match, when no value is found.

In Prime the situation is a bit different because you also can provide your own comparison function. So we can do it that way:

So one point for Prime, but still millions of points against 😉

Regards

Werner

Top Tags