Skip to main content
1-Visitor
March 6, 2017
Solved

Getting a false output

  • March 6, 2017
  • 1 reply
  • 7281 views

Hello Everyone,

I hope everyone is going to have a great week ahead. I am having a problem with a if else statement. Although my summation is matching from both sides but it is evaluating as  "False" in output. It would be very nice if you can help me out with it.

Thanks

Faisal

Best answer by DJF

If all units are removed, it also works

2017-03-06_12-12-12.jpg

I suspect the issue arises because, behind the scenes, Mathcad is working in meters.  So, working with feet engages a additional conversion calculation and that throws it's accuracy off.

1 reply

23-Emerald I
March 6, 2017

You're running afoul of numeric precision; the summation is not exact, so the difference is trivially small but not zero.  Reformulate your test:

fahmed-31-VisitorAuthor
1-Visitor
March 6, 2017

So Mathcad is not good with English Units

23-Emerald I
March 6, 2017

No, Mathcad is fine with units.

Like any other machine addition process, there is a small but finite error in each mathematical calculation.  You're sheet is doing twelve additions, so the error is multiplied by 12.  Then you asked if one number was exactly equal to another, and your computer (not Mathcad) looked at the two numbers and decided they wer not identical.

One of my early calculators would error if I took the sine (of the (sine of( the sine (of 1 degree))), then took the arcsine( of that number) three times; the last operation asked for the arcsine of a number larger than 1.  It was trapped by the error that crept into the process.

Research "numerical accuracy," it's been a dilemma for computer programmers since there were computers.