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
Regular Member

Prime 6.0 - Ceil and Floor function error

Hello everyone,

 

I am experiencing the same rounding error from previous versions in Mathcad Prime 6.0. Have an explanation?  Or, where can I report effectively this error?

 

Thanks!

 

clipboard_image_0.png

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
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

15 REPLIES 15
Highlighted

Re: Prime 6.0 - Ceil and Floor function error


@Alvaro_95 wrote:

Hello everyone,

 

I am experiencing the same rounding error from previous versions in Mathcad Prime 6.0. Have an explanation?  Or, where can I report effectively this error?


Effectively? Nowhere! Don't forget - we are dealing with PTC and they have proven their ... "efficiency" in program development and bug fixing quite effective if you look at the way they "develop" Prime.

If you really go through the hassle of reporting this effect you can open a support case, but only if you have paid them and are under maintenance. The lack of a channel in which everybody can report bugs already tells the whole story about PTCs interest in making their software more bug-free.

 

BTW, AFAIR this bug has already been reported here in the forum a few times (its also present in real Mathcad, so its rather old)  and also shows up without using units:

clipboard_image_0.png

 

 

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Thank you Werner. I will try to report via support contact.
And yes, it will be useful to have a label "report" just as "tips" or "ideas" in the community.
Highlighted

Re: Prime 6.0 - Ceil and Floor function error


@Alvaro_95 wrote:
Thank you Werner. I will try to report via support contact.
And yes, it will be useful to have a label "report" just as "tips" or "ideas" in the community.

This label would only make sense, if relevant PTC-staff would scan a subforum like this on a regular basis and act accordingly. I guess this never will happen. Good luck with your support case.

 

BTW, in MC15 we can set the number of decimal places to 17 and that way we can see whats happening. This at least partially explains the effect - internal round-off errors - possibly due to conversion from decimal in IEEE binary format. The effect also shows if we set the result to 15 decimal numbers. If we do that in Prime (15 is the max possible here), we are not shown that round-off error but obviously its there as we still have the bug in "floor" etc.

clipboard_image_0.png

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Mathcad 11 gives:

clipboard_image_0.png

Luc

Highlighted

Re: Prime 6.0 - Ceil and Floor function error


@LucMeekes wrote:

Mathcad 11 gives:

 

With 17 decimal places?

Thats interesting. I know that MC11 has the better symbolics (with Maple) but was not aware that pure numeric functions also were implemented in a better way and wonder why this changed in later versions.

Basically there is nothing which could be done against the round-off errors themselves as this is a natural conversion effect (0,1 in binary is periodic and has to be cut off somewhere) and a limitation of the IEEE format used to save numbers in numeric mode.

But functions like "Floor" could be written in way so they are aware of this effect and could internally do some clever rounding to avoid it. At least in cases like the one shown here. I guess no matter how clever the function is implemented, it would always be possible to find examples where some error shows up, but it would not be examples with numbers that simple as 2.9 and 0.1.

Here are some more even simpler examples of round-offs. Again in MC15 set to 17 decimal places.

 

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Hmm, it appears that I cannot request 17 decimal places. 15 is the maximum.

But the examples with the (lowecase) floor() functions do show a difference with what you've shown.

Note that the result of the floor() function must be an integer by definition.if the result of 2.9/0.1 would be just below 29, its floor would be 28, not 29.

This:

clipboard_image_0.png

shows that the quotients are spot-on. Or is there something that I'm missing?

 

Luc

Highlighted

Re: Prime 6.0 - Ceil and Floor function error

Hi,

 

It is not really a bug, but a matter of internal precision representation of 0.07 / 0.01 being greater than 7.0000000000000000.

Capture.JPG

Cheers

Re: Prime 6.0 - Ceil and Floor function error

So it looks like MC11 does correct in every respect.

Guess the "improvements" made on the way from MC11 to MC15 were larger than I thought.

 

So you cant demand 17 decimals places but just 15 like we can in Prime.

clipboard_image_0.png

 

Highlighted

Re: Prime 6.0 - Ceil and Floor function error


@terryhendicott wrote:

Hi,

 

It is not really a bug, but a matter of internal precision representation

Guess thats exactly what I wrote above when I mentioned the round-off errors due to conversion from decimal to binary and back (in conjunction with the IEEE format used for internal storage).

The bug is not the lack of precision but the fact, that functions like "Floor" should nonetheless give the correct results with the values shown.

I agree its not a bug as in both versions, real Mathcad and Prime, we have the options to turn off "exact" comparison (as shown in my other answers) and that way get the correct results.

Announcements