galois.is_monic

galois.is_monic(poly)

Determines whether the polynomial is monic, i.e. having leading coefficient equal to 1.

Parameters

poly (galois.Poly) – A polynomial over a Galois field.

Returns

True if the polynomial is monic.

Return type

bool

Examples

In [1]: GF = galois.GF(7)

In [2]: p = galois.Poly([1,0,4,5], field=GF); p
Out[2]: Poly(x^3 + 4x + 5, GF(7))

In [3]: galois.is_monic(p)
Out[3]: True
In [4]: p = galois.Poly([3,0,4,5], field=GF); p
Out[4]: Poly(3x^3 + 4x + 5, GF(7))

In [5]: galois.is_monic(p)
Out[5]: False