From 44c23c7eacbd1adc59d146152fce988879398ad1 Mon Sep 17 00:00:00 2001 From: Aleksandar Kostovic Date: Mon, 29 Apr 2019 08:50:53 +0200 Subject: [PATCH] Created small test for decode_fp32 function --- src/add/fsqrt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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: -- 2.30.2