File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ PMPolynomial >> roots [
239239{ #category : #information }
240240PMPolynomial >> roots: aNumber [
241241
242- | pol roots x rootFinder |
242+ | pol roots root rootFinder |
243243 rootFinder := PMNewtonZeroFinder with: aNumber.
244244 pol := self class coefficients:
245245 (coefficients reverse collect: [ :each | each asFloat ]).
@@ -248,10 +248,10 @@ PMPolynomial >> roots: aNumber [
248248 rootFinder
249249 setFunction: pol;
250250 setDerivative: pol derivative.
251- x := rootFinder evaluate.
251+ root := rootFinder evaluate.
252252 rootFinder hasConverged ] whileTrue: [
253- roots add: x .
254- pol := pol deflatedAt: x .
253+ roots add: root .
254+ pol := pol deflatedAt: root .
255255 pol degree > 0 ifFalse: [ ^ roots ] ].
256256 ^ roots
257257]
You can’t perform that action at this time.
0 commit comments