From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 06:39:34 +0000 (+0100) Subject: fix nan/create unit test fns X-Git-Tag: ls180-24jan2020~882 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21d9ab7e98e671f6adacb6fa05f66f17e32f22f6;p=ieee754fpu.git fix nan/create unit test fns --- diff --git a/src/ieee754/fpcommon/test/unit_test_double.py b/src/ieee754/fpcommon/test/unit_test_double.py index bfa949dc..fca61ead 100644 --- a/src/ieee754/fpcommon/test/unit_test_double.py +++ b/src/ieee754/fpcommon/test/unit_test_double.py @@ -33,14 +33,14 @@ def match(x, y): (x == y) ) -def create(s, e, x): +def create(s, e, m): return (s<<63) | ((e+1023) << 52) | m def inf(s): return create(s, 1024, 0) def nan(s): - return create(s, 1024, 1<<52) + return create(s, 1024, 1<<51) def zero(s): return s<<63 diff --git a/src/ieee754/fpcommon/test/unit_test_half.py b/src/ieee754/fpcommon/test/unit_test_half.py index 9f640846..e00a1b87 100644 --- a/src/ieee754/fpcommon/test/unit_test_half.py +++ b/src/ieee754/fpcommon/test/unit_test_half.py @@ -33,14 +33,14 @@ def match(x, y): (x == y) ) -def create(s, e, x): +def create(s, e, m): return (s<<15) | ((e+15) << 11) | m def inf(s): return create(s, 16, 0) def nan(s): - return create(s, 16, 1<<11) + return create(s, 16, 1<<10) def zero(s): return s<<15