Skip to content
Quake style 1.0/sqrt(x)
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
LICENSE
README.md
package.json
rsqrt.js

README.md

rsqrt

An attempt to port Quake's fast inverse square root to JS. Do not ever use this.

Install:

npm install rsqrt

Example:

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

Something went wrong with that request. Please try again.