Socket
Socket
Sign inDemoInstall

@plato/pmath

Package Overview
Dependencies
85
Maintainers
11
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @plato/pmath

Plato math functions, based on FDLIBM


Version published
Maintainers
11
Created

Readme

Source

@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

FAQs

Last updated on 28 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc