Function: valuation
Section: conversions
C-Name: gvaluation
Prototype: lGG
Help: valuation(x,p): valuation of x with respect to p.
Doc:
 computes the highest
 exponent of $p$ dividing $x$. If $p$ is of type integer, $x$ must be an
 integer, an intmod whose modulus is divisible by $p$, a fraction, a
 $q$-adic number with $q=p$, or a polynomial or power series in which case the
 valuation is the minimum of the valuation of the coefficients.

 If $p$ is of type polynomial, $x$ must be of type polynomial or rational
 function, and also a power series if $x$ is a monomial. Finally, the
 valuation of a vector, complex or quadratic number is the minimum of the
 component valuations.

 If $x=0$, the result is \tet{LONG_MAX} ($2^{31}-1$ for 32-bit machines or
 $2^{63}-1$ for 64-bit machines) if $x$ is an exact object. If $x$ is a
 $p$-adic numbers or power series, the result is the exponent of the zero.
 Any other type combinations gives an error.
