  Let $d$ be any positive and non square integer. We prove an upper bound for
the first two moments of the length $T(d)$ of the period of the continued
fraction expansion for $\sqrt{d}$. This allows to improve the existing results
for the large deviations of $T(d)$.
