# missing-math

> missing features of the Math built-in object

Latest version **3.6.0** (published 2026-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install missing-math
pnpm add missing-math
yarn add missing-math
bun add missing-math
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.6.0 |
| Published | 2026-07-14 |
| First published | 2017-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Arnaud Juracek |
| Maintainers | arnaudjuracek |

## Links

- npm: https://www.npmjs.com/package/missing-math
- Repository: https://github.com/arnaudjuracek/missing-math
- Homepage: https://github.com/arnaudjuracek/missing-math#readme
- Issues: https://github.com/arnaudjuracek/missing-math/issues
- npm.io page: https://npm.io/package/missing-math

## Recent versions

- 3.6.0 (latest) — 2026-07-14
- 3.5.1 — 2025-09-20
- 3.5.0 — 2025-09-20
- 3.4.0 — 2022-08-24
- 3.3.0 — 2022-08-19
- 3.2.0 — 2019-12-14
- 3.1.0 — 2019-06-20
- 3.0.0 — 2019-06-19
- 2.0.1 — 2017-12-23
- 2.0.0 — 2017-12-23

## README

# missing-math
> missing features of the `Math` built-in object

<br>

## Usage
##### Import with a module bundler

```console
$ npm install --save missing-math
```
```js
// using ES6 module
import { clamp, degrees } from 'missing-math'

// using CommonJS module
var { clamp, degrees } = require('missing-math')
```

##### Import from a browser

```html
<script src="https://unpkg.com/missing-math"></script>
<script>
  // all methods are exposed in window.MissingMath
  MissingMath.clamp()
  MissingMath.degrees()
</script>
```

## Methods
- `clamp(value, min, max)`
- `wrap(value, min, max)`
- `normalize(value, min, max[, clamp = false])`
- `map(value, in_min, in_max, out_min, out_max[, clamp = false])`
- `lerp(a, b, t)`
- `random([a[, b[, rng = Math.random]]])`
- `randomInt([a[, b[, rng = Math.random]]])`
- `degrees(radians)`
- `radians(degrees)`
- `roundTo(value, nearest)`
- `floorTo(value, nearest)`
- `fract(value[, decimals])`


## License
[MIT](https://tldrlegal.com/license/mit-license).

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