```python
def harmonic_sum(n):
    """
    Calculates the harmonic sum of n-1.
    The harmonic sum of k is the sum of the reciprocals of the positive integers
    from 1 to k (i.e., 1 + 1/2 + 1/3 + ... + 1/k).
    """
    total_sum = 0.0
    # The loop iterates from 1 up to (but not including) n.
    # This corresponds to the terms 1/1, 1/2, ..., 1/(n-1).
    for i in range(1, n):
        total_sum += 1 / i
    return total_sum

```