From 42d353467dca7fb012450deb8372d438cbbc5062 Mon Sep 17 00:00:00 2001 From: anastasosmoho Date: Thu, 1 Oct 2026 18:02:14 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20works/pr2/3fast=5Finverse=5Fsquare=5Froot=5Fquacklll/m?= =?UTF-8?q?ain3.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/pr2/3fast_inverse_square_root_quacklll/main3.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/works/pr2/3fast_inverse_square_root_quacklll/main3.cpp b/works/pr2/3fast_inverse_square_root_quacklll/main3.cpp index 81cbed0..c76f920 100644 --- a/works/pr2/3fast_inverse_square_root_quacklll/main3.cpp +++ b/works/pr2/3fast_inverse_square_root_quacklll/main3.cpp @@ -1,8 +1,8 @@ #include #include #include -int Q_rsqrt(float number){ - long i; +float Q_rsqrt(float number){ + int32_t i; float x2, y; const float threehalfs = 1.5f; x2 = number * 0.5f; @@ -15,12 +15,11 @@ int Q_rsqrt(float number){ return y; } -int main() { +int main(void) { for (float x = 0.5f; x <= 4.0f; x += 0.5f){ printf("x=%.1f 1/sqrt(x) ~= %.6f\n", x, Q_rsqrt(x)); } return 0; } - - \ No newline at end of file + \ No newline at end of file