File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/Math-Tests-Polynomials Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -245,11 +245,12 @@ PMPolynomialTest >> testPolynomialRoots [
245245{ #category : #' iterative algorithms' }
246246PMPolynomialTest >> testPolynomialRootsForQuadratic [
247247 | polynomial roots |
248- polynomial := PMPolynomial coefficients: #(1 2 1) .
248+ " Here, compute the roots of the quadratic (2x + 1)^2 = 4 x^2 + 4 x + 1"
249+ polynomial := PMPolynomial coefficients: #(1 4 4) .
249250 roots := polynomial roots .
250251 self assert: roots size equals: 2 .
251- self assert: (roots at: 1 ) closeTo: - 1 .
252- self assert: (roots at: 2 ) closeTo: - 1 .
252+ self assert: (roots at: 1 ) closeTo: - 0.5 .
253+ self assert: (roots at: 2 ) closeTo: - 0.5 .
253254]
254255
255256{ #category : #' function evaluation' }
You can’t perform that action at this time.
0 commit comments