From: Luke Kenneth Casson Leighton Date: Sun, 28 Apr 2019 16:51:46 +0000 (+0100) Subject: find MSB-pow-2 in different way X-Git-Tag: ls180-24jan2020~1152 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1af6226965ce1b06bb6694a61a5247cb1b770642;p=ieee754fpu.git find MSB-pow-2 in different way --- 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):