Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How come adding parenthesis screws up the calculation here ? The middle one simply outputted 7 ** 127 without modulating it downfor __ 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
The equation being tested is Mersenne Primes
( M3 ** M7 ) mod M19Thanks.
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 '
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: bignum and parenthesis
by tybalt89 (Monsignor) on Jul 03, 2023 at 18:11 UTC | |
by NERDVANA (Priest) on Jul 03, 2023 at 18:35 UTC | |
by Anonymous Monk on Jul 03, 2023 at 20:18 UTC | |
by pryrt (Abbot) on Jul 03, 2023 at 21:03 UTC | |
by kcott (Archbishop) on Jul 08, 2023 at 08:05 UTC | |
by AnomalousMonk (Archbishop) on Jul 04, 2023 at 19:24 UTC | |
by Anonymous Monk on Jul 03, 2023 at 20:26 UTC | |
by tybalt89 (Monsignor) on Jul 04, 2023 at 05:06 UTC | |
by Dallaylaen (Chaplain) on Jul 16, 2023 at 20:15 UTC |