From: Aleksandar Kostovic Date: Mon, 29 Apr 2019 06:50:53 +0000 (+0200) Subject: Created small test for decode_fp32 function X-Git-Tag: ls180-24jan2020~1120 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44c23c7eacbd1adc59d146152fce988879398ad1;p=ieee754fpu.git Created small test for decode_fp32 function --- diff --git a/src/add/fsqrt.py b/src/add/fsqrt.py index bc80e9f5..da3819c1 100644 --- a/src/add/fsqrt.py +++ b/src/add/fsqrt.py @@ -1,3 +1,6 @@ +from sfpy import Float32 + + # XXX DO NOT USE, fails on num=65536. wark-wark... def sqrtsimple(num): res = 0 @@ -96,6 +99,13 @@ if __name__ == '__main__': ms, es = main(m, e) print("m:%d e:%d sqrt: m:%d e:%d" % (m, e, ms, es)) + + +x = Float32(1234.123456789) +xbits = x.bits + + +print(decode_fp32(x)) """ Notes: