We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9441bb2 commit 8c56c11Copy full SHA for 8c56c11
src/core/Int.pm
@@ -389,7 +389,8 @@ multi sub is-prime(Int:D \i) {
389
nqp::p6bool(nqp::isprime_I(nqp::decont(i), nqp::unbox_i(100)));
390
}
391
multi sub is-prime(\i) {
392
- nqp::p6bool(nqp::isprime_I(nqp::decont(i.Int), nqp::unbox_i(100)));
+ i == i.floor
393
+ && nqp::p6bool(nqp::isprime_I(nqp::decont(i.Int), nqp::unbox_i(100)));
394
395
396
proto sub expmod($, $, $) is pure {*}
0 commit comments