What am I doing wrong with if statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What am I doing wrong with if statement
Hello All,
I am using Mathcad Prime 4.0. As seen in the photo below, I am just trying to use a simple if statement. I am wondering what I am doing wrong? The answer I should be receiving in my check is "OK" . Any suggestions?
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Your running into an accuracy issue. Bear in mind that:
- all united values are ALWAYS internally converted into SI units.
- there is ALWAYS a finite accuracy when dealing with numerics.
Here goes:
So the difference between x-y and z is just above 0.
When comparing numerical data, allow for some tolerance.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Your running into an accuracy issue. Bear in mind that:
- all united values are ALWAYS internally converted into SI units.
- there is ALWAYS a finite accuracy when dealing with numerics.
Here goes:
So the difference between x-y and z is just above 0.
When comparing numerical data, allow for some tolerance.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Makes sense, thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
When comparing numerical data, allow for some tolerance.
One method to acheive this is to use Mathcad's "approximate equality" option:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That will work great in my situation. Thanks!
