Ejemplo n.º 1
0
 def subtract(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval - other.intval)
     elif isinstance(other, ConstReal):
         return ConstReal(self.intval - other.doubleval)
     else:
         binary_typeerror(self, other, u"빼기")
Ejemplo n.º 2
0
 def multiply(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval * other.intval)
     elif isinstance(other, ConstReal):
         return ConstReal(self.intval * other.doubleval)
     else:
         binary_typeerror(self, other, u"곱하기")
Ejemplo n.º 3
0
 def greater_than(self, other):
     if isinstance(other, ConstInteger):
         return ConstBoolean(self.doubleval > other.intval)
     elif isinstance(other, ConstReal):
         return ConstBoolean(self.doubleval > other.doubleval)
     else:
         binary_typeerror(self, other, u"대소 비교")
Ejemplo n.º 4
0
 def add(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval + other.intval)
     elif isinstance(other, ConstReal):
         return ConstReal(self.intval + other.doubleval)
     else:
         binary_typeerror(self, other, u"더하기")
Ejemplo n.º 5
0
 def divide(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval / other.intval)
     elif isinstance(other, ConstReal):
         return ConstReal(self.intval / other.doubleval)
     else:
         binary_typeerror(self, other, u"나누기")
Ejemplo n.º 6
0
 def logic_or(self, other):
     binary_typeerror(self, other, u"또는")
Ejemplo n.º 7
0
 def logic_and(self, other):
     binary_typeerror(self, other, u"그리고")
Ejemplo n.º 8
0
 def greater_than(self, other):
     binary_typeerror(self, other, u"대소 비교")
Ejemplo n.º 9
0
 def subtract(self, other):
     binary_typeerror(self, other, u"빼기")
Ejemplo n.º 10
0
 def equal(self, other):
     binary_typeerror(self, other, u"비교")
Ejemplo n.º 11
0
 def logic_or(self, other):
     if isinstance(other, ConstBoolean):
         return ConstBoolean(self.boolval or other.boolval)
     else:
         binary_typeerror(self, other, u"그리고")
Ejemplo n.º 12
0
 def mod(self, other):
     binary_typeerror(self, other, u"나머지")
Ejemplo n.º 13
0
 def divide(self, other):
     binary_typeerror(self, other, u"나누기")
Ejemplo n.º 14
0
 def multiply(self, other):
     binary_typeerror(self, other, u"곱하기")
Ejemplo n.º 15
0
 def add(self, other):
     binary_typeerror(self, other, u"더하기")
Ejemplo n.º 16
0
 def less_than(self, other):
     binary_typeerror(self, other, u"대소 비교")
Ejemplo n.º 17
0
 def mod(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval % other.intval)
     else:
         binary_typeerror(self, other, u"나머지")