  We explore the distribution of class numbers $h(d)$ of indefinite binary
quadratic forms, for discriminants $d$ such that the corresponding fundamental
unit $\varepsilon_d$ is lower than $d^{1/2+\alpha}$, where $0<\alpha<1/2$. To
do so we find an asymptotic formula for $z^{th}$-moments of such $h(d)$'s, over
$d\leq x$, uniformly for a complex number $z$ in a range of the form
$|z|\leq(\log x)^{1+o(1)}$, $\Re(z)\geq -1$. This is achieved by constructing a
probabilistic random model for these values, which we will use to obtain
estimates for the distribution function of $h(d)$ over our family. As another
application, we give an asymptotic formula for the number of $d$'s such that
$h(d)\leq H$ and $\varepsilon_d\leq d^{1/2+\alpha}$ where $H$ is a large real
number.
