We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2ed759 commit 3a23873Copy full SHA for 3a23873
labfis/uncertainty.py
@@ -147,18 +147,20 @@ def list(cls, listargs):
147
def __round__(self, p=0):
148
current_contex = getcontext()
149
setcontext(self.context)
150
-
+
151
u = Decimal(self._uncertainty)
152
m = Decimal(self._mean)
153
154
- p += -u.adjusted()*(not p)
+ p += -u.adjusted() * (not p)
155
156
u = round(u, p)
157
+ u += Decimal("1e{}".format(-p)) * (not u)
158
159
m = round(m, p)
160
161
setcontext(current_contex)
162
- return m, u
163
+ return labfloat(type(self._mean)(m), type(self._uncertainty)(u))
164
165
def split(self):
166
m, u = self.__round__()
0 commit comments