Function: abs
Section: transcendental
C-Name: gabs
Prototype: Gp
Help: abs(x): absolute value (or modulus) of x.
Description:
 (small):small    labs($1)
 (int):int        mpabs($1)
 (real):real      mpabs($1)
 (mp):mp          mpabs($1)
 (gen):gen:prec        gabs($1, $prec)
Doc: absolute value of $x$ (modulus if $x$ is complex).
 Rational functions are not allowed. Contrary to most transcendental
 functions, an exact argument is \emph{not} converted to a real number before
 applying \kbd{abs} and an exact rational result is returned if possible.
 \bprog
 ? abs(-1)
 %1 = 1
 ? abs(3/7 + 4/7*I)
 %2 = 5/7
 ? abs(1 + I)
 %3 = 1.414213562373095048801688724
 ? w = quadgen(-64); abs(3 + w)
 %4 = 5
 ? w = quadgen(5); abs(1 + w)
 %5 = 2.6180339887498948482045868343656381177
 @eprog\noindent The last example with \kbd{quadgen(5)} is algebraic
 but the result is not rational. Hence it is converted to a floating point
 number using the distinguished real embedding $w \to (1 + \sqrt{5}) / 2$.
 There is no ambiguity with imaginary quadratic numbers since both
 (conjugate complex) embeddings have the same absolute value.

 If $x$ is a polynomial, returns $-x$ if the leading coefficient is
 real and negative else returns $x$. For a power series, the constant
 coefficient is considered instead.
