From 1af6226965ce1b06bb6694a61a5247cb1b770642 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 28 Apr 2019 17:51:46 +0100 Subject: [PATCH] find MSB-pow-2 in different way --- src/add/fsqrt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/add/fsqrt.py b/src/add/fsqrt.py index 135c0f70..dc0922b3 100644 --- a/src/add/fsqrt.py +++ b/src/add/fsqrt.py @@ -1,10 +1,10 @@ # XXX DO NOT USE, fails on num=65536. wark-wark... def sqrtsimple(num): res = 0 - bit = 1 << 14 + bit = 1 - while (bit > num): - bit >>= 2 + while (bit < num): + bit <<= 2 while (bit != 0): if (num >= res + bit): -- 2.30.2