up previous next
FirstNonZero

the first non-zero entry in a MODULEELEM

Syntax
FirstNonZero(V: MODULEELEM): RINGELEM

Description
This function returns the first non-zero entry of V. If it is handed a zero MODULEELEM then an error is signalled.

Example
/**/  Use R ::= QQ[x,y,z];
/**/  R5 := NewFreeModule(R,5);
/**/  V := ModuleElem(R5, [0, 0, x^2+y*z, 0, z^2]);

/**/  FirstNonZero(V);
x^2 +y*z

/**/  FirstNonZeroPosn(V);
2

See Also