Ben's note: Someone with a clue needs to do this.
The Class Number Theorem
Let d, not a perfect square be a discriminant. There are infinitely many primitive quadratic forms f(x,y)=ax^2+bxy+cy^2 with integer coefficients and d=b^2-4ac, however these forms fall into finitely many equivalences classes. Two forms, f_1 and f_2 are said to be equivalent iff f_1(x,y)=f_2(\alpha x+\beta y,\gamma x+\delta y) for some matrix \left(\matrix{\alpha & \beta\\ \gamma & \delta}\right).
The Class Number, h(d), is then the number of such equivalent classes for a given discriminant.
For d>0, let (u_d,v_d) be the fundamental solution of Pell's equation u^2-dv^2=4 (that is the solution with u,v>0 and v minimal). Define \epsilon_d:=u_d+v_d\sqrt{d})/2.
For d<0, define w_d to be: 6 if d=-3, 4 if d=-4 and 2 if d<-4.
Then Dirichlet's Class Number Formula says that for d<0,
and for d>0,
References
1.) Manfred Peter - Value Distribution of L(1,\chi_d)
