is-prime
ErrorsCollection

is-prime

Synthesised documentation from type/Int

From type/Int

See Original text in context

multi sub    is-prime (Int:D $number --> Bool:D)
multi method is-prime (Int:D: --> Bool:D)

Returns True if this Int is known to be a prime, or is likely to be a prime based on a probabilistic Miller-Rabin test.

Returns False if this Int is known not to be a prime.

say 2.is-prime;         # OUTPUT: «True␤» 
say is-prime(9);        # OUTPUT: «False␤»