'Get the modulus of ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(x**2 + 1, modulus=2).get_modulus()
2'

def get_modulus(f):

    domain = f.get_domain()
    if domain.is_FiniteField:
        return Integer(domain.characteristic())
    else:
        raise PolynomialError('not    a    polynomial    over    a    Galois    field')
