A numeric constant equal to an approximation of pi
npm install @typeforce/pi[license-shield-url]: https://img.shields.io/github/license/Typeforce-JS/pi.svg?style=flat-square
[license-url]: https://github.com/Typeforce-JS/pi/blob/master/LICENSE
[npm-downloads-shield-url]: https://img.shields.io/npm/dt/@typeforce/pi.svg?style=flat-square
[npm-version-shield-url]: https://img.shields.io/npm/v/@typeforce/pi.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@typeforce/pi
[unpkg-shield-url]: https://img.shields.io/badge/unpkg-up--to--date-brightgreen.svg?style=flat-square
[unpkg-url]: https://unpkg.com/@typeforce/pi/dist/index.min.js
[![NPM][npm-version-shield-url]][npm-url]
[![NPM][npm-downloads-shield-url]][npm-url]
[![CDN][unpkg-shield-url]][unpkg-url]
[![LICENSE][license-shield-url]][license-url]
The closest approximation to the numeric constant 'pi', the ratio of a circle's
circumference to its diameter.
``shell`
npm install @typeforce/pi --save # Install package via NPM
`javascript
import { expect } from "chai";
import pi from "@typeforce/pi";
// The constant can be accessed directly:
expect(pi.pi).to.be.approximately(Math.PI, 1e-8);
// Or it can be calculated:
expect(pi.calculate()).to.be.approximately(Math.PI, 1e-8);
`
This package contains TypeScript type declarations.
This package can be imported via unpkg as demonstrated
below.
`html`
This package uses Gulp for building, and Chai
and Mocha for testing.
`shell`
npm install # Installs dependencies.
npm run build # Build the project.
npm test # Run tests.
Refer to the LICENSE` file for license information.