projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84722b0
)
find MSB-pow-2 in different way
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 28 Apr 2019 16:51:46 +0000
(17:51 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Sun, 28 Apr 2019 16:51:46 +0000
(17:51 +0100)
src/add/fsqrt.py
patch
|
blob
|
history
diff --git
a/src/add/fsqrt.py
b/src/add/fsqrt.py
index 135c0f707875f298615dcd9701fcea4d3ff270a8..dc0922b33846368f4733ab76dce7fd63f5e10fb1 100644
(file)
--- 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):