File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,26 @@ Returns the given C<Int> raised to the C<$y> power within modulus C<$mod>.
58
58
say expmod(4, 2, 5); # 1
59
59
say 7.expmod(2, 5); # 4
60
60
61
+ = head2 routine polymod
62
+
63
+ Defined as:
64
+
65
+ method polymod(Int:D: +@mods)
66
+
67
+ Usage:
68
+
69
+ INTEGER.polymod(LIST)
70
+
71
+ Returns a sequence of mod results corresponding to the divisors in C < @mods > .
72
+ If the number of divisors is finite, returns one more result than the number
73
+ of divisors, and the final result is the remainder after all the divisions.
74
+ If the number of divisors is infinite, runs until the remainder is 0.
75
+ The Int version of this method assumes all the divisors are also integers.
76
+ Coerce the invocant to Num or Rat if you wish to use fractional operations.
77
+
78
+ say 3600.polymod(60,60,24); # (0 0 1 0)
79
+ say 3661.polymod(60,60,24); # (1 1 1 0)
80
+
61
81
= head2 routine is-prime
62
82
63
83
Defined as:
You can’t perform that action at this time.
0 commit comments