Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve expmod doc
- Clarify what it does for non-mathy types
- Document candidate that can take non-Int types
  • Loading branch information
zoffixznet committed Oct 6, 2016
1 parent f642a18 commit c483276
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/Type/Int.pod6
Expand Up @@ -48,10 +48,13 @@ Example:
Defined as:
multi sub expmod( $x, $y, $mod) returns Int:D
multi sub expmod(Int:D $x, Int $y, Int $mod) returns Int:D
multi method expmod(Int:D: Int $y, Int $mod) returns Int:D
Returns the given C<Int> raised to the C<$y> power within modulus C<$mod>.
Returns the given C<Int> raised to the C<$y> power within modulus C<$mod>,
that is gives the result of C<($x ** $y) mod $mod>. The subroutine form
can accept non-C<Int> arguments, which will be coerced to C<Int>.
say expmod(4, 2, 5); # 1
say 7.expmod(2, 5); # 4
Expand Down

0 comments on commit c483276

Please sign in to comment.