X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fieee754%2Ffpsqrt%2Ffsqrt.py;fp=src%2Fieee754%2Ffpsqrt%2Ffsqrt.py;h=0c8aa1e539f1e9e61d6d8b89610900cda9312a0b;hb=eb7c98a477798c050c7c3103296e3f8f9d6e4bff;hp=f7410703643e763c0ad5c43c57e6c39b3c12e71e;hpb=c9a2ef1e7e5510db37ebde1c3a5faa9efb9a305f;p=ieee754fpu.git diff --git a/src/ieee754/fpsqrt/fsqrt.py b/src/ieee754/fpsqrt/fsqrt.py index f7410703..0c8aa1e5 100644 --- a/src/ieee754/fpsqrt/fsqrt.py +++ b/src/ieee754/fpsqrt/fsqrt.py @@ -93,17 +93,14 @@ def normalise(s, m, e, lowbits): if (e == 128 & m !=0): # these are in IEEE754 format, this function returns s,e,m not z s = 1 # sign (so, s=1) - e = 255 # exponent (minus 128, so e = 127 + e = 127 # exponent (minus 128, so e = 127 m = 1<<22 # high bit of mantissa, so m = 1<<22 i think - m = 1 - m = 1<<22 # rest of mantissa is zero, so m = 1<<22 is good. - m = 0 #if the num is Inf, then adjust (to normalised +/-INF) if (e == 128): # these are in IEEE754 format, this function returns s,e,m not z s = 1 # s is already s, so do nothing to s. - m = 255 # have to subtract 128, so e = 127 (again) + e = 127 # have to subtract 128, so e = 127 (again) m = 0 # mantissa... so m=0 return s, m, e