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