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

36:3(8-6)/6=?

АК_10557065
2-Guest

36:3(8-6)/6=?

_10557065_0-1673890962361.png

Баг? Хотелось бы пояснение по двум вариантам

3 REPLIES 3

We've seen this before. With an implicit multiplication (one where you did NOT type an asterisk * to explicitly force multiplication) Prime assumes there are brackets around it.

So your first example is viewed as:

36 : (3*(8-6))/6=1

 

Remedy:

- Do NOT use the inline division operator ":", and

- Type multiplications explicitly.

 

Success!
Luc


@LucMeekes wrote:

We've seen this before.


Yes, here: Prime Bug - Implicit multiplication - PTC Community

The problem is because Prime implemented a non-standard operator precedence when it comes to implicit multiplications. Its not treated like a "normal" multiplication but is given a higher precedence.

Its not that likely to fall into this trap using just numbers

Werner_E_0-1673953316117.png

but its very easy to fall for it if variables are used

Werner_E_3-1673954389291.png

especially when the expressions get more complicated, using parentheses, etc.

So the best advice still is to avoid using the inline division ÷

 

Implementing implicit multiplication with a higher precedence as normal multiplication may have been done on purpose, especially when you consider that units usually are connected using implicit multiplication.

In the example below

Werner_E_2-1673953728300.png

I guess that most of us will be confused at first glance by the result on the left and would consider the (wrong?) result on the right to be correct (or at least being as expected).
So if implicit multiplication would have been implemented in a standard way considering the order of operators, then the handling of units would have had to be implemented differently. So I clearly understand why it was done the way it was 😉

So once again - the best advice is to avoid using the inline division ÷ !

 

So maybe we should not blame Mathsoft and PTC for having implemented something wrong, but we sure can blame PTC for not making the situation clear in the documentation/help.  Primes help does not know "implicit multiplication", it calls it "scaling operator".

https://support.ptc.com/help/mathcad/r8.0/en/index.html#page/PTC_Mathcad_Help/scaling_operator.html

And the help only states succinctly that "it acts as a multiplication operator" without pointing out that there is a difference in the execution ranking.

Announcements