From 5c0058aba5b26ccf44564b4cc490a08323786983 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 19 Feb 2019 08:05:29 +0000 Subject: [PATCH] whoops FP16 mantissa off-by-one --- src/add/fpbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 5c303046..e6222c2f 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -70,7 +70,7 @@ class FPNum: """ def __init__(self, width, m_extra=True): self.width = width - m_width = {16: 12, 32: 24, 64: 53}[width] # 1 extra bit (overflow) + m_width = {16: 11, 32: 24, 64: 53}[width] # 1 extra bit (overflow) e_width = {16: 7, 32: 10, 64: 13}[width] # 2 extra bits (overflow) e_max = 1<<(e_width-3) self.rmw = m_width # real mantissa width (not including extras) -- 2.30.2