From 21d9ab7e98e671f6adacb6fa05f66f17e32f22f6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 07:39:34 +0100 Subject: [PATCH] fix nan/create unit test fns --- src/ieee754/fpcommon/test/unit_test_double.py | 4 ++-- src/ieee754/fpcommon/test/unit_test_half.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.30.2