Example #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"빼기")
Example #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"곱하기")
Example #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"대소 비교")
Example #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"더하기")
Example #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"나누기")
Example #6
0
 def logic_or(self, other):
     binary_typeerror(self, other, u"또는")
Example #7
0
 def logic_and(self, other):
     binary_typeerror(self, other, u"그리고")
Example #8
0
 def greater_than(self, other):
     binary_typeerror(self, other, u"대소 비교")
Example #9
0
 def subtract(self, other):
     binary_typeerror(self, other, u"빼기")
Example #10
0
 def equal(self, other):
     binary_typeerror(self, other, u"비교")
Example #11
0
 def logic_or(self, other):
     if isinstance(other, ConstBoolean):
         return ConstBoolean(self.boolval or other.boolval)
     else:
         binary_typeerror(self, other, u"그리고")
Example #12
0
 def mod(self, other):
     binary_typeerror(self, other, u"나머지")
Example #13
0
 def divide(self, other):
     binary_typeerror(self, other, u"나누기")
Example #14
0
 def multiply(self, other):
     binary_typeerror(self, other, u"곱하기")
Example #15
0
 def add(self, other):
     binary_typeerror(self, other, u"더하기")
Example #16
0
 def less_than(self, other):
     binary_typeerror(self, other, u"대소 비교")
Example #17
0
 def mod(self, other):
     if isinstance(other, ConstInteger):
         return ConstInteger(self.intval % other.intval)
     else:
         binary_typeerror(self, other, u"나머지")