Commit 94ece98d authored by ulrich_y's avatar ulrich_y

Added function for n-th Harmonic number as in 813c6de9

parent e9d0bc8c
...@@ -78,6 +78,20 @@ CONTAINS ...@@ -78,6 +78,20 @@ CONTAINS
bernoullinumber = bernoulli(n) bernoullinumber = bernoulli(n)
END FUNCTION bernoullinumber END FUNCTION bernoullinumber
FUNCTION harmonicnumber(n)
integer, intent(in) :: n
real(kind=prec) :: harmonicnumber
integer, parameter :: nmax = 40
real(kind=prec), save :: Harmonic(0:nmax) = 0
integer, save :: m = 0
do m=m, n+1
harmonic(m+1) = harmonic(m) + 1._prec / real(m+1)
enddo
harmonicnumber = harmonic(n)
END FUNCTION
FUNCTION Li2(x) FUNCTION Li2(x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment