mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 12:51:10 +00:00
fix: external type specification bug
This commit is contained in:
parent
83cd92bb48
commit
905a03d578
10 changed files with 153 additions and 64 deletions
|
@ -20,33 +20,18 @@ class Float(float):
|
|||
def __add__(self, other):
|
||||
return then__(float.__add__(self, other), Float)
|
||||
|
||||
def __radd__(self, other):
|
||||
return then__(float.__add__(float(other), self), Float)
|
||||
|
||||
def __sub__(self, other):
|
||||
return then__(float.__sub__(self, other), Float)
|
||||
|
||||
def __rsub__(self, other):
|
||||
return then__(float.__sub__(float(other), self), Float)
|
||||
|
||||
def __mul__(self, other):
|
||||
return then__(float.__mul__(self, other), Float)
|
||||
|
||||
def __rmul__(self, other):
|
||||
return then__(float.__mul__(float(other), self), Float)
|
||||
|
||||
def __div__(self, other):
|
||||
return then__(float.__div__(self, other), Float)
|
||||
|
||||
def __rdiv__(self, other):
|
||||
return then__(float.__div__(float(other), self), Float)
|
||||
|
||||
def __floordiv__(self, other):
|
||||
return then__(float.__floordiv__(self, other), Float)
|
||||
|
||||
def __rfloordiv__(self, other):
|
||||
return then__(float.__floordiv__(float(other), self), Float)
|
||||
|
||||
def __pow__(self, other):
|
||||
return then__(float.__pow__(self, other), Float)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue