From 34926fc2f4bdf50961f03b8cf2aead461b2d0408 Mon Sep 17 00:00:00 2001 From: Samuel Lord <9904667+NodeMixaholic@users.noreply.github.com> Date: Sat, 27 Jan 2024 14:10:42 -0600 Subject: [PATCH] Update index.js --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d651031..d5c3e64 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ -//now even more amazing! function fastInverseSqrt(number) { const threehalfs = 1.5; const x2 = number * 0.5; @@ -6,5 +5,9 @@ function fastInverseSqrt(number) { i[0] = number; let y = new Int32Array(i.buffer); y = threehalfs - (x2 * y * y); + y = Math.abs(y); + y = (y / 1000000000000000000); + y = Math.round(y * 100) / 100; + y = y - .1; return y; }