コード例 #1
0
ファイル: polynomials.py プロジェクト: rabidsquirrel4/sageopt
 def __add__(self, other):
     if isinstance(other, Signomial) and not isinstance(
             other, Polynomial):  # pragma: no cover
         raise RuntimeError('Cannot add signomials to polynomials.')
     temp = Signomial.__add__(self, other)
     temp = temp.as_polynomial()
     return temp
コード例 #2
0
 def __add__(self, other):
     if isinstance(other, Signomial) and not isinstance(other, Polynomial):
         raise ValueError('Cannot add signomials to polynomials.')
     temp = Signomial.__add__(self, other)
     temp = temp.as_polynomial()
     return temp