summaryrefslogtreecommitdiff
path: root/scalarfloat.py
diff options
context:
space:
mode:
Diffstat (limited to 'scalarfloat.py')
-rw-r--r--scalarfloat.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scalarfloat.py b/scalarfloat.py
index 7f7d26d..fca8be2 100644
--- a/scalarfloat.py
+++ b/scalarfloat.py
@@ -35,6 +35,7 @@ class ScalarFloat(float):
def __iadd__(self, a): # type: ignore
# type: (Any) -> Any
+ return float(self) + a
x = type(self)(self + a)
x._width = self._width # type: ignore
x._underscore = self._underscore[:] if self._underscore is not None else None # type: ignore # NOQA
@@ -42,6 +43,7 @@ class ScalarFloat(float):
def __ifloordiv__(self, a): # type: ignore
# type: (Any) -> Any
+ return float(self) // a
x = type(self)(self // a)
x._width = self._width # type: ignore
x._underscore = self._underscore[:] if self._underscore is not None else None # type: ignore # NOQA
@@ -49,13 +51,16 @@ class ScalarFloat(float):
def __imul__(self, a): # type: ignore
# type: (Any) -> Any
+ return float(self) * a
x = type(self)(self * a)
x._width = self._width # type: ignore
x._underscore = self._underscore[:] if self._underscore is not None else None # type: ignore # NOQA
+ x._prec = self._prec # check for others
return x
def __ipow__(self, a): # type: ignore
# type: (Any) -> Any
+ return float(self) ** a
x = type(self)(self ** a)
x._width = self._width # type: ignore
x._underscore = self._underscore[:] if self._underscore is not None else None # type: ignore # NOQA
@@ -63,6 +68,7 @@ class ScalarFloat(float):
def __isub__(self, a): # type: ignore
# type: (Any) -> Any
+ return float(self) - a
x = type(self)(self - a)
x._width = self._width # type: ignore
x._underscore = self._underscore[:] if self._underscore is not None else None # type: ignore # NOQA