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

Bug in Passing Values to User?

Highlighted
Newbie

Bug in Passing Values to User?

Mathcad appears to be passing values different from their full precision. In my user-defined function, I was checking to see whether the value passed was greater than 1.400. When I use 1.3994 in Mathcad, the user function sees it as less than 1.400, but when I use 1.3995, the user function sees it as greater than 1.400. The same function in Mathcad 7 worked fine.
2 REPLIES 2
Highlighted

Bug in Passing Values to User?

OK, you've got my attention. Can you please post your worksheet? I'm dying to see your example.
Highlighted

Bug in Passing Values to User?

It is not quite as bad as I thought. (I was rounding to the third decimal place internally.)

However, when I use 1.4 in Mathcad, it passes 1.3999999999999999.
When I do a floor(value + 0.5) in C it comes out 1.4000000000000001
which passes the GREATER THAN test when I don't want it to.
It did work okay in Mathcad 7.
Announcements