1.源码实现
from sympy import *
x = symbols('x')
a = x**3 + 1
b = x**2 - 1
#g为商, h为余数
g,h = div(a, b)
print(g)
print(h)
2.运行及结果
$ python3 example.py
x
x + 1
from sympy import *
x = symbols('x')
a = x**3 + 1
b = x**2 - 1
#g为商, h为余数
g,h = div(a, b)
print(g)
print(h)
$ python3 example.py
x
x + 1
本文标题:sympy多项式除法
本文链接:https://www.haomeiwen.com/subject/uswunktx.html
网友评论