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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

About relational tests tolerance

Al2000
1-Visitor

About relational tests tolerance

Hi guys. Sorry if the question was answered long time ago, but I had not find it in older posts. It is about tolerance in relational tests in MC 2001. I guess this is known for all you but I'm relatively new to MC and it keeps surprising me.

One of my functions is giving wrong results in some rare cases. This function finds the minimum value of an array, locate that minimum, do some calcs and test the result against a reference value. After manually tracing the error I finally learned that:

- "min" function returns the true minimum value.
- "match" function returns position of match according to value of TOL.
- relational tests (<,=,>) work with a fixed tolerance of about 10^-13.

When 2 computed values differ in the least significant digits, maybe due to rounding, the described method can fail 'cause is not picking the true minimum value.

As work-around I found that I can lower the default tolerance to 10^-16 to make "match" return the true position of the true minimum, and doing relational tests against zero, i.e. test "a-b < 0" instead of "a < b".

My question: can I trust that the test against zero will work always? Testing against zero will do an absolute test?

Saludos,

Al
3 REPLIES 3
RichardJ
19-Tanzanite
(To:Al2000)

If you go to tools, worksheet options, calculation, do you have a check box "Use exact equality for boolean comparisons"?

Richard
Al2000
1-Visitor
(To:RichardJ)

On 1/6/2010 2:39:40 PM, rijackson wrote:
>If you go to tools, worksheet
>options, calculation, do you
>have a check box "Use exact
>equality for boolean
>comparisons"?

Nope, MC2001 do not have that option.

Al
RichardJ
19-Tanzanite
(To:Al2000)

Yes, you are right. It was introduced in version 11. Here's the Quicksheet.

Richard
Announcements

Top Tags