fix bug in nan/inf, exp-bias needed subtracting
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 12:47:01 +0000 (12:47 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 14 Feb 2019 12:47:01 +0000 (12:47 +0000)
src/add/nmigen_add_experiment.py

index 68d15bd4f536af17060da80b9ecaeee296f95a9b..914074c9a5b80567ad97b2b2747fdd6381d181c0 100644 (file)
@@ -42,10 +42,10 @@ class FPNum:
                            Cat(self.m[0] | self.m[1], self.m[1:-5], 0))
 
     def nan(self, s):
-        return self.create(s, 0xff, 1<<22)
+        return self.create(s, 0x80, 1<<22)
 
     def inf(self, s):
-        return self.create(s, 0xff, 0)
+        return self.create(s, 0x80, 0)
 
     def is_nan(self):
         return (self.e == 128) & (self.m != 0)