text: A simple algebraic extension  of a field , generated by the root of an irreducible polynomial  of degree  may be identified to the quotient ring , and its elements are in bijective correspondence with the polynomials of degree less than . The addition in  is the addition of polynomials. The multiplication in  is the remainder of the Euclidean division by  of the product of polynomials. Thus, to complete the arithmetic in , it remains only to define how to compute multiplicative inverses. This is done by the extended Euclidean algorithm.
  The algorithm is very similar to that provided above for computing the modular multiplicative inverse. There are two main differences: firstly the last but one line is not needed, because the Bézout coefficient that is provided always has a degree less than . Secondly, the greatest common divisor which is provided, when the input polynomials are coprime, may be any non zero elements of ; this Bézout coefficient (a polynomial generally of positive degree) has thus to be multiplied by the inverse of this element of . In the pseudocode which follows,  is a polynomial of degree greater than one, and  is a polynomial.
  function inverse(a, p)
  t := 0;     newt := 1
  r := p;     newr := a
  while newr ≠ 0 do
  quotient := r div newr
  (r, newr) := (newr, r − quotient × newr)
  (t, newt) := (newt, t − quotient × newt)
  if degree(r) > 0 then
  return "Either p is not irreducible or a is a multiple of p"
  return (1/r) × t