# @plato/pmath

> Plato math functions, based on FDLIBM

Latest version **0.4.6** (published 2026-02-19) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @plato/pmath
pnpm add @plato/pmath
yarn add @plato/pmath
bun add @plato/pmath
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.6 |
| Published | 2026-02-19 |
| First published | 2019-10-16 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 333.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Maintainers | geoffblair, fralmei, platochris, evgeny_trubish, k4rliky, platobot |

## Links

- npm: https://www.npmjs.com/package/@plato/pmath
- npm.io page: https://npm.io/package/@plato/pmath

## Dependencies (3)

- [nan](https://npm.io/package/nan.md) ^2.22.2
- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^11.2.0

## Recent versions

- 0.4.6 (latest) — 2026-02-19
- 0.4.5 — 2026-02-19
- 0.4.4 — 2026-01-12
- 0.4.3 — 2025-11-17
- 0.4.2 — 2025-06-12
- 0.4.1 — 2024-03-28
- 0.4.0 — 2022-06-15
- 0.2.0 — 2020-03-27
- 0.1.2 — 2019-10-17
- 0.1.1 — 2019-10-17
- 0.1.0 — 2019-10-16

## README

# @plato/pmath

Plato math functions, based on [FDLIBM](https://www.netlib.org/fdlibm/readme).

This package is a [Node.js Addon](https://nodejs.org/api/addons.html) and is compiled from source during package install for the target platform and current version of Node.js.

_NOTE: Consider using [`node-pre-gyp`](https://www.npmjs.com/package/node-pre-gyp) to build/host prebuilt binaries instead._

## Usage

Install via Yarn:

```sh
yarn add @plato/pmath
```

Import the package and invoke exported math functions:

```ts
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:

```sh
git submodule update --init
```

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

```sh
yarn
```

### Build

The build steps can be invoked manually as well:

To manually build FDLIBM, run:

```sh
yarn build-fdlibm
```

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

```sh
yarn build
```

### Test

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

```sh
yarn test
```

---
_Source: https://npm.io/package/@plato/pmath · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
