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