예제 #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
 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