in reply to Re^3: bignum and parenthesis
in thread bignum and parenthesis

echo " python3.11.4 :: $( python3 -c 'print( ( 2**3 - 1 )**( 2**7 - 1 + ) % ( 2**19 - 1 ) )' )" echo " perl 5.36 :: $( perl -Mbignum -le 'print ( 2**3 - 1 )**( 2**7 - + 1 ) % ( 2**19 - 1 )' )" echo " gawk 5.2.2 :: $( gawk -p- -Mbe 'BEGIN { print ( ( 2^3 - 1 ) ^ ( + 2^7 - 1 ) ) % ( 2 ^ 19 - 1 ) }' )" python3.11.4 :: 102010 perl 5.36 :: 7 gawk 5.2.2 :: 102010 # gawk profile, created Mon Jul 3 16:24:54 2023 # BEGIN rule(s) BEGIN { 1 print ((2 ^ 3 - 1) ^ (2 ^ 7 - 1)) % (2 ^ 19 - 1) }
perl is somewhat singular in this regard

Replies are listed 'Best First'.
Re^5: bignum and parenthesis
by tybalt89 (Monsignor) on Jul 04, 2023 at 05:06 UTC

    I see you haven't read perlfunc yet.

    print ( 2**3 - 1 )**( 2**7 - 1 ) % ( 2**19 - 1 )
    is equivalent to
    ( print ( 2**3 - 1 ) )**( 2**7 - 1 ) % ( 2**19 - 1 )
    and not the
    print( ( 2**3 - 1 )**( 2**7 - 1 ) % ( 2**19 - 1 ) )
    that you think it is.

    That's why I put a + before the first parenthesis - it's one of the few times where a unary + is highly significant.

    UPDATE: added the word "unary"