Skip to content

Commit 4c2ea19

Browse files
author
Jan-Olof Hendig
committed
Added documentation for polymod
1 parent 2111887 commit 4c2ea19

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/Type/Int.pod

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ Returns the given C<Int> raised to the C<$y> power within modulus C<$mod>.
5858
say expmod(4, 2, 5); # 1
5959
say 7.expmod(2, 5); # 4
6060
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+
6181
=head2 routine is-prime
6282
6383
Defined as:

0 commit comments

Comments
 (0)