Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Re: Prime 6.0 - Ceil and Floor function error

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-12-2019
06:42 PM

10-12-2019
06:42 PM

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!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
02:39 PM

10-13-2019
02:39 PM

The solution is simple.

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

15 REPLIES 15

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-12-2019
08:50 PM

10-12-2019
08:50 PM

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:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-12-2019
09:32 PM

10-12-2019
09:32 PM

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.

And yes, it will be useful to have a label "report" just as "tips" or "ideas" in the community.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
04:26 AM

10-13-2019
04:26 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
05:03 AM

10-13-2019
05:03 AM

Re: Prime 6.0 - Ceil and Floor function error

Mathcad 11 gives:

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
05:14 AM

10-13-2019
05:14 AM

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
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
07:03 AM

10-13-2019
07:03 AM

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:

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

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
09:35 AM

10-13-2019
09:35 AM

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.

Cheers

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
02:00 PM

10-13-2019
02:00 PM

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.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

10-13-2019
02:19 PM

10-13-2019
02:19 PM

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.