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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Issue with the inequality symbol

jenny29
4-Participant

Issue with the inequality symbol

I created an if function for one of my equations and when I plug in the equal value as a solution, it does not recognize it as a correct value even though the inequality symbol shows that it has to be. Mathcad issue.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
MJG
18-Opal
18-Opal
(To:jenny29)

Because of how computers store numbers, Mathcad actually calculates H/L to be 0.19999999999999998.  Since this is slightly under 0.2, the if statement returns "NG".

To alleviate this, uncheck the option "use exact equality for comparisons and truncation" under Tools -> Worksheet Options -> Calculation

View solution in original post

4 REPLIES 4

Under menu "Tools/Worksheet options," on the calculation tab, uncheck "use exact equality for comparisons and truncation"

MJG
18-Opal
18-Opal
(To:jenny29)

Because of how computers store numbers, Mathcad actually calculates H/L to be 0.19999999999999998.  Since this is slightly under 0.2, the if statement returns "NG".

To alleviate this, uncheck the option "use exact equality for comparisons and truncation" under Tools -> Worksheet Options -> Calculation

jenny29
4-Participant
(To:MJG)

Thank you for the clarification!

LouP
11-Garnet
(To:jenny29)

Instead of changing worksheet options, another possibility I believe is robust is to avoid the use of specific numeric entries in inequalities. Instead of typing 0.20 in the Ratio program inequality, define a named constant (e.g., RefRatio:=Hhill/Lh) and use RefRatio in the inequality.

 

Lou

Top Tags