Commit 062cfe3c authored by Cerlane Leong's avatar Cerlane Leong 💬

Python sqrt type casting error

parent db47b3b9
......@@ -1270,7 +1270,8 @@ class posit8:
def rint(self):
return _softposit.p8_roundToInt(self.v)
def sqrt(self):
return _softposit.p8_sqrt(self.v)
self.v = _softposit.p8_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP8ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......@@ -1557,7 +1558,8 @@ class posit16:
def rint(self):
return _softposit.p16_roundToInt(self.v)
def sqrt(self):
return _softposit.p16_sqrt(self.v)
self.v = _softposit.p16_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP16ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......@@ -1845,7 +1847,8 @@ class posit32:
def rint(self):
return _softposit.p32_roundToInt(self.v)
def sqrt(self):
return _softposit.p32_sqrt(self.v)
self.v = _softposit.p32_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP32ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......
......@@ -217,7 +217,8 @@ class posit8:
def rint(self):
return _softposit.p8_roundToInt(self.v)
def sqrt(self):
return _softposit.p8_sqrt(self.v)
self.v = _softposit.p8_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP8ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......@@ -504,7 +505,8 @@ class posit16:
def rint(self):
return _softposit.p16_roundToInt(self.v)
def sqrt(self):
return _softposit.p16_sqrt(self.v)
self.v = _softposit.p16_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP16ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......@@ -792,7 +794,8 @@ class posit32:
def rint(self):
return _softposit.p32_roundToInt(self.v)
def sqrt(self):
return _softposit.p32_sqrt(self.v)
self.v = _softposit.p32_sqrt(self.v)
return self
def __repr__(self):
a = float(_softposit.convertP32ToDouble(self.v))
if (a == float('inf')) or (a==float('-inf')) or (a==float('nan')):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment