Skip to content

Estimate pi with the Wallis product

License

Notifications You must be signed in to change notification settings

kenany/wallis-product

Repository files navigation

wallis-product

Estimate pi with the Wallis product.

Example

const wallis = require('wallis-product');

wallis(10);
// => 3.0677038066434976

wallis(10000000);
// => 3.141592575082479

Installation

$ npm install wallis-product

API

const wallis = require('wallis-product');

wallis(n)

Returns an approximation of pi using the Wallis infinite product up to a term of Number n.