Function: quadunitnorm
Section: number_theoretical
C-Name: quadunitnorm
Prototype: lG
Help: quadunitnorm(D): return the norm of the fundamental unit of the
 quadratic order of discriminant D.
Doc: return the norm ($1$ or $-1$) of the fundamental unit of the quadratic
 order of discriminant $D$. The integer $D$ must be congruent to $0$ or $1$
 modulo $4$ and not a square. This is of course equal to \kbd{norm(quadunit(D))}
 but faster.
 \bprog
 ? quadunitnorm(-3) \\ the result is always 1 in the imaginary case
 %1 = 1
 ? quadunitnorm(5)
 %2 = -1
 ? quadunitnorm(17345)
 %3 = -1
 ? u = quadunit(17345)
 %4 = 299685042291 + 4585831442*w
 ? norm(u)
 %5 = -1
 @eprog\noindent This function computes the parity of the continued fraction
 expansion and runs in time $\tilde{O}(D^{1/2})$. If $D$ is fundamental,
 the function \kbd{bnfinit} is asymptotically faster but depends of the GRH.
 If $D = df^2$ is not fundamental, it will usually be faster to first compute
 \kbd{quadunitindex}$(d, f)$. If it is even, the result is $1$, else the result
 is \kbd{quadunitnorm}$(d)$. The narrow class number of the order of
 discriminant $D$ is equal to the class number if the unit norm is $1$ and to
 twice the class number otherwise.
