Feat: Polynomial are displayed in nicer order!
This commit is contained in:
@@ -104,12 +104,12 @@ class Polynomial(Token):
|
||||
>>> P
|
||||
<Polynomial 3x^2 + 2x + 1>
|
||||
>>> P.differentiate()
|
||||
<Linear 2 + 6x>
|
||||
<Linear 6x + 2>
|
||||
>>> for s in P.differentiate().explain():
|
||||
... print(s)
|
||||
0 + 2 + 3 * 2x
|
||||
2 + 3 * 2 * x
|
||||
2 + 6x
|
||||
6x + 2
|
||||
"""
|
||||
return Expression(self._mo.differentiate()).simplify()
|
||||
|
||||
@@ -212,7 +212,7 @@ class Quadratic(Polynomial):
|
||||
4 - 12
|
||||
- 8
|
||||
>>> P.differentiate()
|
||||
<Linear 2 + 6x>
|
||||
<Linear 6x + 2>
|
||||
>>> P.roots
|
||||
[]
|
||||
|
||||
|
@@ -174,7 +174,7 @@ class Token(object):
|
||||
>>> a = Integer(3)
|
||||
>>> c = a - "x"
|
||||
>>> c
|
||||
<Linear 3 - x>
|
||||
<Linear - x + 3>
|
||||
"""
|
||||
return self._operate(other, "-")
|
||||
|
||||
|
Reference in New Issue
Block a user