"If" statement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
"If" statement
Hi
Can anyone tell me why tp > (e-2mm) where:
tp=20mm
e=22mm
It should be equal to each other!!!
Thanks
Best regards
Waleed Khalid
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
To see the difference, you need to set the results format to show 17 digits.
The simplest workaround for the values you are dealing with its to go to Worksheet Options in the Tools menu, got to the Calculations tab and then deselect the "Use exact equality for Boolean and Truncation functions" option. This let's Mathcad regard n numbers with an absolute difference of 10^-12 as being the same.
Stuart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Computers carry arithmetic to ridiculous levels and generate small errors at each step. So 22-2 is rarely (if ever) precisely 20, and your equality test says it's not. Ask Mathcad to evaluate
tp - (e-2mm) =
And see how far apart the two values are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Fred, thanks for reply
tp - (e-2mm) = 0.00000mm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
To see the difference, you need to set the results format to show 17 digits.
The simplest workaround for the values you are dealing with its to go to Worksheet Options in the Tools menu, got to the Calculations tab and then deselect the "Use exact equality for Boolean and Truncation functions" option. This let's Mathcad regard n numbers with an absolute difference of 10^-12 as being the same.
Stuart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Many thanks. It works now 🙂
