1
私はsympyを使用し、この時点で多項式
sympy.count_roots:で作業型の不一致実多項式
from sympy.abc import x
from sympy import Poly
p = Poly(x**4+0.1,x)
の根の数を計算しようとしています
、pはドメイン「RR」と多項式である:Poly(1.0*x**4 + 0.1, x, domain='RR')
私は間隔で根の数を計算しようとすると、私が手:しかし
p.count_roots(0,2)
TypeError: unsupported operand type(s) for *=: 'RealElement' and 'PythonRational'
、私は
を定義した場合同様
p.count_roots()
ans: 1
の作品同様
q = Poly(x**3-1, x)
ans: Poly(x**3 - 1, x, domain='ZZ')
q.count_roots(0,2)
ans: 1
、私はドメイン全体にp
の根の数を求めるならば、私はcount_rootsへの正しい種類を供給するために何をすべき?