Ejemplo n.º 1
0
 def __floordiv__(self, b):
     # override the built-in function floordiv
     # return the integer division of the two value
     # genBase to int
     tmp1 = self.todecimal()
     tmp2 = b.todecimal()
     return genBase(10, str(tmp1//tmp2))
Ejemplo n.º 2
0
 def __mul__(self, b):
     # override the built-in function mul
     # return the multiplication of the two value
     # genBase to int
     tmp1 = self.todecimal()
     tmp2 = b.todecimal()
     return genBase(10, str(tmp1*tmp2))
Ejemplo n.º 3
0
 def __add__(self, b):
     # override the built-in function add
     # return the sum of the two value
     # genBase to int
     tmp1 = self.todecimal()
     tmp2 = b.todecimal()
     return genBase(10, str(tmp1+tmp2))
Ejemplo n.º 4
0
 def __sub__(self, b):
     # override the built-in function sub
     # return the substraction of the two value
     # genBase to int
     tmp1 = self.todecimal()
     tmp2 = b.todecimal()
     return genBase(10, str(tmp1-tmp2))  
Ejemplo n.º 5
0
 def __mod__(self, b):
     # override the built-in function mod
     # return the mod of the two value
     # genBase to int
     tmp1 = self.todecimal()
     tmp2 = b.todecimal()
     return genBase(10, str(tmp1%tmp2))