In his masterwork Disquisitiones Arithmeticae, Gauss stated an approxi
mate formula for the average of the class number for negative discrimi
nants. In this paper we improve the known estimates for the error term
in Gauss approximate formula. Namely, our result can be written as N-
1 Sigma(n less than or equal to N) H(-n) = 4 pi root N/(21 zeta(3) - 2
pi(2) + O(N-15/44+epsilon) for every epsilon > 0, where H(-n) is, in
modern notation, h(-4n). We also consider the average of h(-n) itself
obtaining the same type of result. Proving this formula we transform f
irstly the problem in a lattice point problem las probably Gauss did)
and we use a functional equation due to Shintani and Dirichlet class n
umber formula to express the error term as a sum of character and expo
nential sums that can be estimated with techniques introduced in a pre
vious work on the sphere problem.