0.4.1 • Published 2 months ago

@plato/pmath v0.4.1

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
2 months ago

@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
0.4.1

2 months ago

0.4.0

2 years ago

0.2.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago