On a class number formula for real quadratic number fields