projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a77330d
)
reduce code duplication
author
Jacob Lifshay
<programmerjake@gmail.com>
Sun, 14 Jul 2019 09:42:43 +0000
(
02:42
-0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Sun, 14 Jul 2019 09:42:43 +0000
(
02:42
-0700)
src/ieee754/fpcommon/fpbase.py
patch
|
blob
|
history
diff --git
a/src/ieee754/fpcommon/fpbase.py
b/src/ieee754/fpcommon/fpbase.py
index ecb2a632b661f45ee32e30cf76b8334821229c70..b8deab021f2f8080270b71a656bb7ebf7e20f030 100644
(file)
--- a/
src/ieee754/fpcommon/fpbase.py
+++ b/
src/ieee754/fpcommon/fpbase.py
@@
-71,10
+71,11
@@
class FPFormat:
def __repr__(self):
""" Get repr. """
- if (self.width in (16, 32, 64, 128)
- or (self.width > 128 and self.width % 32 == 0)):
+ try:
if self == self.standard(self.width):
return f"FPFormat.standard({self.width})"
+ except ValueError:
+ pass
retval = f"FPFormat({self.exponent_width}, {self.mantissa_width}"
if self.has_int_bit is not False:
retval += f", {self.has_int_bit}"