Esempio n. 1
0
 def __pow__(self, other):
     if isinstance(other,Measurement):
         # Haven't calcuated variance in (a+/-da) ** (b+/-db)
         return NotImplemented
     else:
         if (not self.variance is None) and hasattr(other,'variance') and not other.variance is None:
             return Measurement(*err1d.pow(self.x,self.variance,other))
         else:
             return Measurement(pow(self.x,other),None)
Esempio n. 2
0
 def __pow__(self, other):
     if isinstance(other, Uncertainty):
         # Haven't calcuated variance in (a+/-da) ** (b+/-db)
         return NotImplemented
     else:
         return Uncertainty(*err1d.pow(self.x, self.variance, other))
Esempio n. 3
0
 def __rtruediv__(self, other):
     x, variance = err1d.pow(self.x, self.variance, -1)
     return Uncertainty(x * other, variance * other**2)
Esempio n. 4
0
 def __rtruediv__(self, other):
     if (not self.variance is None) and hasattr(other,'variance') and not other.variance is None:
         x,variance = err1d.pow(self.x,self.variance,-1)
         return Measurement(other/self.x,variance*other**2)
     else:
         return Measurement(other/self.x,None)
Esempio n. 5
0
 def __rtruediv__(self, other):
     x,variance = err1d.pow(self.x,self.variance,-1)
     return Uncertainty(x*other,variance*other**2)
Esempio n. 6
0
 def __pow__(self, other):
     if isinstance(other,Uncertainty):
         # Haven't calcuated variance in (a+/-da) ** (b+/-db)
         return NotImplemented
     else:
         return Uncertainty(*err1d.pow(self.x,self.variance,other))
Esempio n. 7
0
 def __rtruediv__(self, other):
     x,variance = err1d.pow(self.x,self.variance,-1)
     return Measurement(x*other,variance*other**2)
Esempio n. 8
0
 def __rtruediv__(self, other):
     x, variance = err1d.pow(self.x, self.variance, -1)
     return Measurement(x * other, variance * other**2)