RosettaCodeData/Task/Modular-arithmetic/Perl/modular-arithmetic.pl

4 lines
90 B
Perl
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
use Math::ModInt qw(mod);
sub f { my $x = shift; $x**100 + $x + 1 };
print f mod(10, 13);