Skip to content

Commit

Permalink
refactor: Rename Method, and now we have the interface that a client …
Browse files Browse the repository at this point in the history
…(in this case the test) needs.
  • Loading branch information
hemalvarambhia committed Dec 24, 2023
1 parent 251c5b6 commit 8dbe917
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/Math-Polynomials/PMPolynomial.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ PMPolynomial >> negated [
^ self * -1
]

{ #category : #information }
PMPolynomial >> orderedRoots [
"comment stating purpose of instance-side method"
"scope: class-variables & instance-variables"

^ (self roots: Float defaultComparisonPrecision) asSortedCollection asArray
]

{ #category : #printing }
PMPolynomial >> printOn: aStream [
"Append to aStream a written representation of the receiver."
Expand Down Expand Up @@ -239,6 +231,14 @@ PMPolynomial >> reciprocal [
^ (PMPolynomial coefficients: #(1)) / self
]

{ #category : #information }
PMPolynomial >> roots [
"comment stating purpose of instance-side method"
"scope: class-variables & instance-variables"

^ (self roots: Float defaultComparisonPrecision) asSortedCollection asArray
]

{ #category : #information }
PMPolynomial >> roots: aNumber [

Expand Down
2 changes: 1 addition & 1 deletion src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ PMPolynomialTest >> testPolynomialRoots [

| polynomial roots |
polynomial := PMPolynomial coefficients: #( -10 -13 -2 1 ).
roots := polynomial orderedRoots .
roots := polynomial roots .
self assert: roots size equals: 3.
self assert: (roots at: 1) + 2 closeTo: 0.
self assert: (roots at: 2) + 1 closeTo: 0.
Expand Down

0 comments on commit 8dbe917

Please sign in to comment.