Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Баг? Хотелось бы пояснение по двум вариантам
Bug? I would like clarification on two options.
Google translate
Translated by - Anurag Singh
Date - 02/03/2023
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
but its very easy to fall for it if variables are used
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
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.