for __ in $$; do perl -Mbignum -le 'print 7 ** 127 % 524287 ' perl -Mbignum -le 'print ( 7 ** 127 ) % ( 524287 )' echo ' ( 7 ^ 127 ) % 524287 ' | bc done | gcat -b 1 102010 2 212545092456801670844330383105896224333193816736399849985499 +757869483902203328714236393937418376186556719543 3 102010
How come adding parenthesis screws up the calculation here ? The middle one simply outputted 7 ** 127 without modulating it down

The equation being tested is Mersenne Primes

    ( M3 ** M7 ) mod M19
Thanks.
perl -V Summary of my perl5 (revision 5 version 36 subversion 1) configuration +: Platform: osname=darwin osvers=22.4.0 archname=darwin-thread-multi-2level uname='darwin ventura-arm64.local 22.4.0 darwin kernel version 22. +4.0: mon mar 6 20:55:35 pst 2023; root:xnu-8796.101.5~3release_arm64_ +vmapple arm64 '

In reply to bignum and parenthesis by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.