@@ -245,22 +245,22 @@ PMPolynomialTest >> testPolynomialRoots [
245
245
{ #category : #' iterative algorithms' }
246
246
PMPolynomialTest >> testPolynomialRootsConstantsHaveNoRoots [
247
247
248
- | polynomial |
248
+ | constant |
249
249
" Here, compute the roots of the constant C = 1"
250
- polynomial := PMPolynomial coefficients: #( 1 ) .
250
+ constant := PMPolynomial coefficients: #( 1 ) .
251
251
self
252
- should: [ polynomial roots ]
252
+ should: [ constant roots ]
253
253
raise: Error
254
254
description: ' Function' ' s derivative seems to be zero everywhere'
255
255
]
256
256
257
257
{ #category : #' iterative algorithms' }
258
258
PMPolynomialTest >> testPolynomialRootsForLinear [
259
259
260
- | polynomial roots |
260
+ | linearPolynomial roots |
261
261
" Here, compute the roots of the linear (2x + 1)"
262
- polynomial := PMPolynomial coefficients: #( 1 2 ) .
263
- roots := polynomial roots.
262
+ linearPolynomial := PMPolynomial coefficients: #( 1 2 ) .
263
+ roots := linearPolynomial roots.
264
264
self assert: roots size equals: 1 .
265
265
self assert: (roots at: 1 ) closeTo: - 0.5
266
266
]
@@ -279,10 +279,10 @@ PMPolynomialTest >> testPolynomialSubtraction [
279
279
280
280
{ #category : #' iterative algorithms' }
281
281
PMPolynomialTest >> testPolynomialWithRepeatedRoots [
282
- | polynomial roots |
282
+ | polynomialWithRepeatedRoots roots |
283
283
" Here, compute the roots of the quadratic (2x + 1)^2 = 4 x^2 + 4 x + 1"
284
- polynomial := PMPolynomial coefficients: #(1 4 4) .
285
- roots := polynomial roots .
284
+ polynomialWithRepeatedRoots := PMPolynomial coefficients: #(1 4 4) .
285
+ roots := polynomialWithRepeatedRoots roots .
286
286
self assert: roots size equals: 2 .
287
287
self assert: (roots at: 1 ) closeTo: - 0.5 .
288
288
self assert: (roots at: 2 ) closeTo: - 0.5 .
0 commit comments