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

Prime 6.0 - Ceil and Floor function error

SOLVED
Highlighted

Re: Prime 6.0 - Ceil and Floor function error

It gets even more crazy!

I open the MC11 file which Luc had attached and opened it with MC15.

As you can see in the screen shot - all calculations are correct now!

Even if I retype from scratch one of the expressions which formerly gave a wrong result, the result now is correct!!

When I open an new sheet and copy the region with the correct result from Luc's sheet to the new one, I get the wrong result again.

My test expression was floor(2.9/0.1) which gives 29 in Luc's sheet and 28 in a sheet created with MC15.

I also saved Luc's sheet with MC15 in xmcdz format and then reloaded it, but the results still are correct!

 

EDIT: Found it!! Silly me - I really should have thought on that from the very beginning!

In real Mathcad one can influence the calculation behavior and in Lucs Sheet in the Worksheet Options the option "Use exact equality for comparison and truncation" was unchecked, while in my sheet this by default was checked.

Unchecking this options makes sense, I guess.

clipboard_image_0.png

 

 

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Mathcad 11 gives me these options:

clipboard_image_0.png

The setting that comes closest to Mathcad 15's "Use exact equality for comparison and truncation"  is the last box: "Use exact equality foor boolean comparisons"

Of course I've tried it. There's no difference in any of the results. Checked or unchecked, I get:

clipboard_image_1.png

I've saved the file now with the box checked. Please check how it translates to Mathcad 15..

 

Luc

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Here is what I see when I open your new sheet.

The box is still checked and some results of course are wrong. Unchecking the box talks Mathcad into delivering correct results.

clipboard_image_0.png

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

The solution is simple.

Check "Approximate Equality" ("Calculation" ribbon, "Calculation Options") and you should get the correct result:

clipboard_image_0.png

clipboard_image_0.png

View solution in original post

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Very helpful! Thank you Werner. This at least hide the precision error from Mathcad.

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

 
Announcements