Hi Todd,

Yes, ** stands for exponentiation. And exponentiation has higher
precedence than multiplication. See below (I dropped a few zeros to
help clarify):

> put 2 * 10 ** 20
200000000000000000000
> put (2 * 10) ** 20
104857600000000000000000000
> put 2 * (10 ** 20)
200000000000000000000
> 20 ** 20
104857600000000000000000000
>

https://docs.raku.org/language/operators

HTH, Bill.


On Sat, May 16, 2020 at 2:33 PM ToddAndMargo via perl6-users
<perl6-us...@perl.org> wrote:
>
> On 2020-05-14 22:26, Peter Pentchev wrote:
> >> And what is `2 * 100 ** 2000 `?  Is that `(2 x 100)^ 2000`
> >> ((2 times 100) to the 2000 power?
> > Point 1: exponentiation has a higher priority than multiplication.
> >
> > Point 2:https://rosettacode.org/wiki/Integer_roots
>
> Any chance of you answering the question directly?
>
> Is it (2 x 100)^ 2000
>
> Or 2 x ( 100^ 2000 )    2 times (100 to the 2000 power)?
>
> Your point 1 only applies if it is an exponent.  Is the
> 2000 an exponent?  Does ** stand for exponent?

Reply via email to