An open API service indexing awesome lists of open source software.

https://github.com/howion/nth-harmonic

Computes nth harmonic number from the digamma function
https://github.com/howion/nth-harmonic

javascript library math mathematics typescript

Last synced: about 2 months ago
JSON representation

Computes nth harmonic number from the digamma function

Awesome Lists containing this project

README

          

# nth-harmonic

Computes **nth** harmonic number with [**digamma function**](https://en.wikipedia.org/wiki/Digamma_function).

![Digamma and nth-Harmonic Equation](https://raw.githubusercontent.com/howion/box/master/nth-harmonic/harmonic-series-digamma-relationship.png)

## Why

Because it's much faster then casual summing operation for large values of **`n`** and it's more precise.

## Installation

From [**NPM**](https://www.npmjs.com/package/nth-harmonic)

```bash
npm install nth-harmonic
```

## Usage

```js
import nthHarmonic from 'nth-harmonic' // ES6 OR TYPESCRIPT
```

```js
nthHarmonic($n: number): number
```

## License
[**MIT**](https://github.com/howion/nth-harmonic/blob/master/LICENSE)