File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,14 @@ PMPolynomial >> negated [
193193 ^ self * - 1
194194]
195195
196+ { #category : #information }
197+ PMPolynomial >> orderedRoots [
198+ " comment stating purpose of instance-side method"
199+ " scope: class-variables & instance-variables"
200+
201+ ^ self roots asSortedCollection asArray
202+ ]
203+
196204{ #category : #printing }
197205PMPolynomial >> printOn: aStream [
198206 " Append to aStream a written representation of the receiver."
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ PMPolynomialTest >> testPolynomialRoots [
235235
236236 | polynomial roots |
237237 polynomial := PMPolynomial coefficients: #( -10 -13 -2 1 ) .
238- roots := polynomial roots asSortedCollection asArray .
238+ roots := polynomial orderedRoots .
239239 self assert: roots size equals: 3 .
240240 self assert: (roots at: 1 ) + 2 closeTo: 0 .
241241 self assert: (roots at: 2 ) + 1 closeTo: 0 .
You can’t perform that action at this time.
0 commit comments