# Division in ℤ/pℤ or in ℤ/pℤ[x]: /

### 5.34.8 Division in ℤ/pℤ or in ℤ/pℤ[x]: /

The / operator divides two integers in ℤ/pℤ or two polynomials A and B in ℤ/pℤ[x]. (See also Section 5.8.2.) Since ℤ/pℤ is only a field if p is prime, the quotient is only guaranteed to exist if p is prime (unless the denominator is 0 (mod p )).

- For integers in ℤ/pℤ:

  #### Example.

  - Input:
    5%13/2% 13
    Since 13 is prime, you get:
    Output:

    | ⎛ ⎝ | −4 | ⎞ ⎠ | %13

  - Input:
    5%14/3% 14
    Since 3(mod 1 )4 is invertible in Z/14ℤ, you get:
    Output:

    | ⎛ ⎝ | −3 | ⎞ ⎠ | %14

  - Input:
    5%14/7% 14
    Since 7(mod 1 )4 is not invertible in Z/14ℤ, you will get an error: Output:
    Not invertible Error: Bad Argument Value
- For polynomials, the result of P/Q is its irreducible representation in ℤ/pℤ[x].

  #### Example.

  Input:

  (2*x^2+5)%13/(5*x^2+2*x-3)%13

  Output:

  ⎛ ⎝ | 6%13 | ⎞ ⎠ | x+1%13

  ⎛ ⎝ | 2%13 | ⎞ ⎠ | x+ | ⎛ ⎝ | 2%13 | ⎞ ⎠ | %13