コード例 #1
0
ファイル: rootoftools.py プロジェクト: glyg/sympy
 def key(c):
     '''return, for ax**n+b, +/-root(abs(b/a), b) according to the
     apparent sign of the imaginary interval, e.g. if the interval
     were (0, 3) the positive root would be returned.
     '''
     u, f, k = c
     r = _root(abs(f.TC() / f.LC()), f.degree())
     if u.ay < 0 or u.by < 0:
         return -r
     return r
コード例 #2
0
ファイル: rootoftools.py プロジェクト: A-turing-machine/sympy
 def key(c):
     '''return, for ax**n+b, +/-root(abs(b/a), b) according to the
     apparent sign of the imaginary interval, e.g. if the interval
     were (0, 3) the positive root would be returned.
     '''
     u, f, k = c
     r = _root(abs(f.TC()/f.LC()), f.degree())
     if u.ay < 0 or u.by < 0:
         return -r
     return r