# fast-inv-sqrt

> The infamous fast inverse square root function, now in JS & TS.

Latest version **1.0.2** (published 2018-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-inv-sqrt
pnpm add fast-inv-sqrt
yarn add fast-inv-sqrt
bun add fast-inv-sqrt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-11-30 |
| First published | 2018-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oliver Heard |
| Maintainers | ogwh |

## Links

- npm: https://www.npmjs.com/package/fast-inv-sqrt
- Repository: https://github.com/reasonink/fast-inv-sqrt
- npm.io page: https://npm.io/package/fast-inv-sqrt

## Recent versions

- 1.0.2 (latest) — 2018-11-30
- 1.0.1 — 2018-11-30
- 1.0.0 — 2018-11-30

## README

# Fast Inverse Square Root for JS & TS

Implements the infamous
[Fast Inverse Square Root function](https://en.wikipedia.org/wiki/Fast_inverse_square_root)
of Quake fame.

This library exports a single `invSqrt(x)` function that calculates (estimates)
`1/Math.sqrt(x)`, but with a 5x performance improvement.

## Installation

Just `npm add` or `yarn add` the module `fast-inv-sqrt`.

## Usage

```typescript
import { invSqrt } from "fast-inv-sqrt";

console.log(invSqrt(256));       // 0.06239419684904888
console.log(1 / Math.sqrt(256)); // 0.0625
```

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