AdvancedIntegerMathHarmonicNumber Method |
Computes the given harmonic number.
Namespace:
Meta.Numerics.Functions
Assembly:
Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax public static double HarmonicNumber(
int n
)
Public Shared Function HarmonicNumber (
n As Integer
) As Double
public:
static double HarmonicNumber(
int n
)
static member HarmonicNumber :
n : int -> float
Parameters
- n
- Type: SystemInt32
The index of the harmonic number to compute, which must be non-negative.
Return Value
Type:
DoubleThe harmonic number H
n.
Exceptions Remarks Hn is the nth partial sum of the harmonic series.
Since the harmonic series diverges, Hn grows without bound as n increases, but
it does so extremely slowly, approximately as log(n).
See Also