Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add expmod and is-prime

  • Loading branch information...
commit 2e336562bdca282c537dba70577d1ad7bfa6e0b8 1 parent ef228dd
@moritz moritz authored
Showing with 12 additions and 1 deletion.
  1. +4 −0 docs/ChangeLog
  2. +7 −0 src/core/Int.pm
  3. +1 −1  tools/build/NQP_REVISION
View
4 docs/ChangeLog
@@ -1,3 +1,7 @@
+New in 2012.10
+
++ Int.is-prime and Int.expmod
+
New in 2012.09
+ class Iterable does not inherit from class Cool anymore
+ basic macro unquoting
View
7 src/core/Int.pm
@@ -54,6 +54,13 @@ my class Int does Real {
nqp::p6box_s(nqp::base_I(self, $b));
}
+ method expmod(Int:D: Int:D \base, Int:D \mod) {
+ nqp::expmod_I(self, nqp::p6decont(base), nqp::p6decont(mod), Int);
+ }
+ method is-prime(Int:D: Int:D $tries = 100) returns Bool:D {
+ nqp::p6bool(nqp::isprime_I(self, nqp::unbox_i($tries)));
+ }
+
method floor(Int:D:) { self }
method round(Int:D:) { self }
method ceiling(Int:D:) { self }
View
2  tools/build/NQP_REVISION
@@ -1 +1 @@
-2012.09
+2012.09-2-gc458a08
Please sign in to comment.
Something went wrong with that request. Please try again.