Skip to content

Commit 321b092

Browse files
committed
== now returns True if |x1-x2| < 2(σ1+σ2)
!= now returns True if |x1-x2| > 3(σ1+σ2)
1 parent 47c2053 commit 321b092

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labfis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ def __trunc__(self):
5757

5858
def __eq__(self, other):
5959
if isinstance(other, labfloat):
60-
return abs(self.mean - other.mean) < 2 * (self.uncertainty - other.uncertainty)
60+
return abs(self.mean - other.mean) < 2 * (self.uncertainty + other.uncertainty)
6161
if isinstance(other, Number):
6262
return abs(self.mean - other) < 2 * self.uncertainty
6363

6464
def __ne__(self, other):
6565
if isinstance(other, labfloat):
66-
return abs(self.mean - other.mean) > 3 * (self.uncertainty - other.uncertainty)
66+
return abs(self.mean - other.mean) > 3 * (self.uncertainty + other.uncertainty)
6767
if isinstance(other, Number):
6868
return abs(self.mean - other) > 3 * self.uncertainty
6969

0 commit comments

Comments
 (0)