Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » finite field extensions » getNonUnit
next | previous | forward | backward | up | index | toc

# getNonUnit -- retrieve a previously discovered non-unit

- Usage:
    `getNonUnit R`
- Inputs:
  - R, a ring, in which division by a non-unit may have been attempted
- Outputs:
  - a ring element, the non-unit, if any, or null

## Description

If a ring has been declared to be a field, using toField or frac, but a nonzero element is found to not be a unit, this routine will return that element, otherwise null is returned.

    i1 : A = ZZ/101[a]/(a^2-1);

    i2 : toField A

    o2 = A[]

    o2 : PolynomialRing

    i3 : 1//(a-1)

    o3 = 0

    o3 : A

    i4 : getNonUnit A

Warning: this function does not work yet for divisions attempted in the course of computing a Gröbner basis or resolution.

## See also

- toField -- declare that a ring is a field
- frac -- construct a fraction field

## For the programmer

The object getNonUnit is a function closure.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/getNonUnit-doc.m2:28:0.