<< Integer utilities Integer utilities gf_mod >>

Galois Fields >> Galois Fields > Integer utilities > gf_is_prime

gf_is_prime

Tests whether integers are prime

Syntax

tf = gf_is_prime(x)

Arguments

x

Matrix of non-negative integers, smaller than 2^53.

tf

Boolean matrix of the same size as x: T where the entry is prime.

Description

gf_is_prime tests each entry of x by trial division. 0 and 1 are not prime. It can be used to check a characteristic before calling gf_create_field.

Examples

gf_is_prime([0 1 2 9 97])      // [F F  T F T]
x = 1:30;
x(gf_is_prime(x))              // primes up to 30

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< Integer utilities Integer utilities gf_mod >>