Version: Pro 3.25.2.0 (3.25.2) on Ubuntu 16.04
As the scripting language is said to be ECMA script which seems to have a power operator '**' I am puzzled because this seems to raise an error when I try to use it. It appears that I can use Math.pow(x,y) but this is not very convenient to use in many mathematical expressions.
Is it the case that the QCAD scripting language does not support the "**" operator, or is there something that I am missing here?
Thanks, and cheers,
- charles
[solved] math power operator **
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
-
- Junior Member
- Posts: 16
- Joined: Wed Nov 28, 2018 9:17 pm
Re: math power operator **
The exponentiation '**' is ECMAScript 6 also known as ES6 and ECMAScript 2015.
What was the second major revision to JavaScript.
There is no solution, you cannot polyfill operators.
Regards,
CVH
What was the second major revision to JavaScript.
There is no solution, you cannot polyfill operators.
Regards,
CVH
Re: math power operator **
You can use Math.pow() or in QCAD also simply pow().
-
- Junior Member
- Posts: 16
- Joined: Wed Nov 28, 2018 9:17 pm
Re: math power operator **
Thanks for the help.
- charles
- charles
Re: [solved] math power operator **
I am a little puzzled by Andrew's answer.
At first it seemed that one wants to criticize my help, again, but now it seems even more incorrect to me.
The topic is clearly about scripting.
A direct question for the language version was never answered.
https://qcad.org/rsforum/viewtopic.php?t=6945&p=26672
It supports RMath.pow(base, exponent).
It doesn't support the exponentiation operator '**', and one can not polyfill an operator.
But it should be avoided in scripting.
https://qcad.org/rsforum/viewtopic.php? ... 539#p24541
Having clarified that,
I am considering to revoke all notifications.
CVH
At first it seemed that one wants to criticize my help, again, but now it seems even more incorrect to me.
The topic is clearly about scripting.
Charles Dyer wrote: ↑Sun Jan 10, 2021 4:45 amIs it the case that the QCAD scripting language does not support the "**" operator?
The ECMAScript language implementation is basic, prior to ES6.
A direct question for the language version was never answered.
https://qcad.org/rsforum/viewtopic.php?t=6945&p=26672
It supports RMath.pow(base, exponent).
It doesn't support the exponentiation operator '**', and one can not polyfill an operator.
The simple.js script implements the derivative pow(base, exponent) for the use in the QCAD GUI.
But it should be avoided in scripting.
https://qcad.org/rsforum/viewtopic.php? ... 539#p24541
Having clarified that,
I am considering to revoke all notifications.
CVH