Example #1
0
 def __rtruediv__(self, other):
     if isinstance(other, (int, float)):
         other = my.numtup(other)
         return Decimales(my.division(other, self.z))
     if isinstance(other, Decimales):
         return Decimales(my.division(other, self.z))
Example #2
0
 def __eq__(self, other):
     if type(other) != tuple:
         other = my.numtup(other)
     return my.comparacion(self.z, other)
Example #3
0
 def __rmul__(self, other):
     if isinstance(other, (int, float)):
         other = my.numtup(other)
         return Decimales(my.multiplicacion1(other, self.z))
     if isinstance(other, Decimales):
         return Decimales(my.multiplicacion1(other, self.z))
Example #4
0
 def __rsub__(self, other):
     if isinstance(other, (int, float)):
         other = my.numtup(other)
         return Decimales(my.resta1(other, self.z))
     if isinstance(other, Decimales):
         return Decimales(my.resta1(other, self.z))
Example #5
0
 def __init__(self, z):  #parametro son las tuplas, enteros y decimales
     self.z = z
     if (type(z) is int) or (type(z) is float):
         self.z = my.numtup(z)
     else:
         self.z = z
Example #6
0
 def __add__(self, other):
     if isinstance(other, (int, float)):
         other = my.numtup(other)
         return Decimales(my.suma(self.z, other))
     if isinstance(other, Decimales):
         return Decimales(my.suma(self.z, other))
 def __truediv__(self, other):
     if isinstance(other, Decimales):
         return Decimales(my.division(self.z, other.z))
     elif isinstance(other, (int, float)):
         return Decimales(my.division(self.z, my.numtup(other)))