@plato/pmath
TypeScript icon, indicating that this package has built-in type declarations

0.4.1 • Public • Published

@plato/pmath

Plato math functions, based on FDLIBM.

This package is a Node.js Addon and is compiled from source during package install for the target platform and current version of Node.js.

NOTE: Consider using node-pre-gyp to build/host prebuilt binaries instead.

Usage

Install via Yarn:

yarn add @plato/pmath

Import the package and invoke exported math functions:

import { atan2, cos, sin } from "@plato/pmath";

const n = cos(10);

console.log(`cos(10) = ${n}`);

Development

Install & Update

When pulling updates or initially cloning this repo, make sure to update the submodules by running:

git submodule update --init

Afterwards, simply installing Yarn dependencies will build the native addon (the build scripts are triggered during package install). Run:

yarn

Build

The build steps can be invoked manually as well:

To manually build FDLIBM, run:

yarn build-fdlibm

To manually build the native Node.js addon (requires FDLIBM to have been built previously), run:

yarn build

Test

Execute unit tests (after the native addon is built) by running:

yarn test

/@plato/pmath/

    Package Sidebar

    Install

    npm i @plato/pmath

    Weekly Downloads

    19

    Version

    0.4.1

    License

    UNLICENSED

    Unpacked Size

    266 kB

    Total Files

    94

    Last publish

    Collaborators

    • platobot
    • edgarplato
    • k4rliky
    • nickav
    • evgeny_trubish
    • jeremyjackson89
    • geoffblair
    • fralmei
    • platochris
    • hyperandroid
    • bennettstruttman
    • nazariglez