Beispiel #1
0
 def __rmul__(self, y):
     if y is zero:
         return zero
     if isinstance(y, type(1)) or isinstance(y,type(1.0)):
         return scaleHPR(y, self)
     if getPtype(y).includes(numType):
         return scaleHPR(y, self)
     Errors.errorOnStaticTypes("Mul", "SHPR", y)
Beispiel #2
0
 def __div__(self, y):
     if y is zero:
         print("Universal Explosion")
         return zero
     if isinstance(y, type(1)) or isinstance(y,type(1.0)):
         return scaleHPR((1.0/y), self)
     if getPtype(y).includes(numType):
         return scaleHPR((1.0/y), self)
     Errors.errorOnStaticTypes("Div", "SP2", y)