<< gf_divide Element arithmetic gf_is_zero >>

Galois Fields >> Galois Fields > Element arithmetic > gf_is_one

gf_is_one

Tests whether an array represents the unit element

Syntax

tf = gf_is_one(a)

Arguments

a

Real vector: an element or a polynomial, constant term first.

tf

T if the first entry of a is 1 and all the others are 0.

Description

gf_is_one(a) tests whether a is the unit element 1 (or the constant polynomial 1). The entries of a are read in column order, so it is meant for a single element.

Examples

F = gf_create_field(2, 4);
gf_is_one(gf_power(F, [0 1 0 0], 15))   // T
gf_is_one([0 1 0 0])                    // F

See also

History

VersionDescription
2.0.0

Refactoring of the function/toolbox.


Report an issue
<< gf_divide Element arithmetic gf_is_zero >>