Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mikolalysenko/rsqrt

Quake style 1.0/sqrt(x)
https://github.com/mikolalysenko/rsqrt

Last synced: 6 days ago
JSON representation

Quake style 1.0/sqrt(x)

Awesome Lists containing this project

README

        

rsqrt
=====
An attempt to port [Quake's fast inverse square root](http://en.wikipedia.org/wiki/Fast_inverse_square_root) to JS. Do not ever use this.

## Install:

npm install rsqrt

## Example:

```javascript
console.log(require("rsqrt")(100.0)) //Prints out approximately 0.1
```

## `require("rsqrt")(number)`
Computes an approximation for `1.0 / Math.sqrt(number)`

## Should I ever use this?

No. `1.0 / Math.sqrt` is at least twice as fast.

## Why did you publish this?

To warn others.

## Credits
(c) 2013 Mikola Lysenko. MIT License