@constants/pi
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

pi

NPM NPM CDN LICENSE

The closest approximation to the numeric constant 'pi', the ratio of a circle's circumference to its diameter.

Usage

    npm install @primitive/is-array --save   # Install package via NPM
    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.

Content Delivery Network (CDN)

This package can be imported via unpkg as demonstrated below.

    <script src="https://unpkg.com/@primitive/is-array/dist/index.min.js">
    <script type="application/javascript">
        var x = Math.PI;
        if (x === pi) {
            // Yay!
        }
    </script>

Build & Test

This package uses Gulp for building, and Chai and Mocha for testing.

    npm install     # Installs dependencies.
    npm run build   # Build the project.
    npm test        # Run tests.

License

Refer to the LICENSE file for license information.

Readme

Keywords

Package Sidebar

Install

npm i @constants/pi

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • mgthomas99